Added Py3 compatibility.