There was a problem with branching on negative conditions. Turns out I declared the condition code as an unsigned number, so it was never actually expressing negative conditions.