Fixing python3; flake8 cleaning