Ensure sort works correctly