Add unique identifiers to groups.