If it has the gold IDM stator flywheel combo that has no points at is a CDI with two coils it was defective at the factory sometimes it will fire four times a revolution. If your tail light was all wonky you should investigate the ceramic resistor that's located under the bulbs the plate prize up and you'll get access to the compartment that has the resistor sometimes it will break and that's your running light and it will make the bike stall but like he said if it has a two-pole output instead of a three or four then it's a newer CDI but if it's an older one and a points model the resistor would matter if it is a CDI it could be that your ground for your Killswitch is making contact eliminate the kill switch for diagnosis also if it's multiwire take the blue black grounded to the frame do the same for the tail light ground grounded to the frame also run the signal wire out to the coil and run a ground strap from the regulator mount on the wiring harness to the frame