Fixed problems with Py3