Safer setting of contact type