build script changes & flake8 fixes