Fixes bug 806994 - Added functional tests where missing in the middleware.