Fixed sort by tests to pass