Fixed hash sorting bug