Improvements.
Py2/3 compatibility.