Fix for Python2 compatibility.