Fixed sorting test case