Simple fixes in group by change