Fix grouping blocks