Pep8 corrections and removal of unused imports