Inverted the logic of the debounce routine. Now 0 = off, 1 = on.