Make the middleware extension compatible with Turbogears 2.2.0.