some py2 fixes