Add flake8 test and fix its warnings.