I think I may have figured it out. I removed the wiring for the head and tail light since they were not functional anyway, repaired the rigged up wiring, and removed the lighting module. It seems to be working fine now. No more cut out at mid to high RPM.