Why do you check for < 0? Isn't != 0 sufficient (as in line 2569)?