fixing tests and pep8