Py3k compat, and pep8