Updated references to optional `req` to avoid errors.