fix pep8 and tests