Fixing sorting issue.