Thank you, however the brake lights are not always on. They do work properly.
Normally, yes, the dirty contacts are the culprit. However in the case of my car, it was a bad splice by the previous owner.
There is something else wrong with the rear defogger, I try using the switch, but it still doesn't work.