Fixed activities' query sorting.