query clauses for entities defined in newQuery are now respected (Closes #739)