Improve support for GROUP BY