Fix calling middleware.