small fixes and flake8 compliant