Added flake8 tests and resulting fixes. Fixed all examples.