Fix middlware usage.