pep8 and py3k fixes