Py3 compatability fixes
Py3 compatibility fixes