Bug fix: First sort the data set, then apply filters