flake8 clean, also fix one bug