Fixing grouping expressions inside subqueries

Fixing grouping expressions inside subqueries

Edit