Fixed sort glitch