Fixing inconsistent behaviour between SimpleQuery and complex queries.