Fix grouping scopes