slightly better smart group contact matching (thanks @justinvdm)