Fix for python 3.x's map() behavior.