Fixed py2/py3 incompat