Correctly sort results.