Fixed sorting bug.