More fixes in QueryBuilder