Fixed results sorting bug