Update middleware order to resolve flash.keep issue and unnecessary logging

Fixes #57