Python3 fixes and code cleanups