Fixed a bug with negative numbers