pep8 and logging fix