Fixed pep8 and pyflakes errors