Fixed a bug where the limits weren't being calculated correctly for negative numbers.