I've found that a small bit of duct tape does wonders in keeping the headlight lens assembly from unscrewing itself from the rest of the headlight when subjected to vibration. It's a pity that there are no SAE specs for bicycle electric systems. Anyhow, I'd also include Loctite in the list.