Fixing pep8 issues and logging cleanup.