Fixes to queries.