Fixed a python3 issue with incorrect use of map