Some changes in the queries view to fix a problem with the sorted results.