Fix broken sort