Fixed failing tests from changes and added test changes to test the sort order of the result list