Fix "contact is not defined" error in resolveContact.