Fix mapper.py to work with python3