fixed tests and pep8.