Fix use of SortBy in getrecords2
Create tests for sorting