Some py2 fixes/cleanups