fixes for pep8 and other minor fixes