fix bug not identifying some aggregate queries as such
jira: close MB-8967