Fix DB error when creating a new contact and a group is selected (#1489051)