some py3k fixes