fix errors and pep8