Fixed bug on first level sort