Fix issue with map() to list() for Python 3