Fix spec for middleware