fix global 'group by' analysis