Fixed the sorting.