fixed all unittests and pep8 violations