I noticed grooves on the latch board where the door latch slid up to close and ride back through when opening the door. This allowed the lower part of the door to open before the top thus allowing one of the switches to sense the door was open and the other to sense the door was closed. Replacing the latch board fixed the problem. While I was at it I replaced the door latch and spring. Now it works perfectly.