Fix nested groups.