Updated map() calls to be py3 compatible on imap adapter