Fixed Py3 errors