Fixing broken sorting.