Fix nested group prefixes.