I echo Stuart's post. I had tempermental tail lights, one side working, one not, etc. Turned out to be the mounting bracket wasn't torqued tight to the bed. I was banging my head against the wall, thinking it was wiring, switches, bulbs, when it turned out to be a bolt!
Bill