Fix pep8 errors and warnings