Py23 compatibility

Bringing Python2 compatibility.

No breaking changes.