Corrects py3 errors