Fix query order in filters.