Fixed the unstable sort