fixes to the query interface