Check comparisons for very negative numbers as well.

Merged from patch by @sebastianmika.
Applies to Draft4 as well.