Fix regression: Sorting by category not working