fix hidden bug: don't call 'flash' from middleware
remove unneeded code from middleware
whitespace
Merge pull request #21 from dsgh/master

As promised, pull request to remove unneeded code