some py3 fixes