Fix regression of sort order from #10391