Fixed flake8 errors and requirement issues