merge_groups(): Use group_base() for connecting groups