Fix single table ordered queries.