Removes middleware.