Fixed results ordering in DatabaseQueries.