Fix inverted logic in increment and decrement functions