Fix failing tests

some pep8 cleanups, better logging