Smarter handling of fn_group_contacts for #6737.