Remove debug and fix flake8 issues