Right under the stock airbox there is a conenctor that may be the source of your trouble. I think it is the main connection of the front lights to the wiring harness. The connector holds moisture due to it's location under the airbox, and many I've seen we're severely corroded. My first XJ was so badly corroded that I ended up splicing out the connector, bypassing and removing it. This solved my problems with front blinkers and headlights.
Your troubles may be elsewhere but it couldn't hurt to take a quick look, remove your airbox and open the connector to see the possible carnage.
I hope this helps.