Fixed sorting bug when numbers are negative