I think you are on the right track, check your electrical connections, grounds, wires and connectors. If it were a rectifier/regulator, then you would probably have charging issues as well. Use a multimeter and check the voltage at the headlight plug. If it is ok, try replacing the bulb.
Yours truly, sincerelly, love always, Josh aka The DirtDemon.