Fix the CBC query grouping