Merge pull request #1517 from WanWizard/develop

fixed query grouping when using where($array) syntax