(backport) Fix brittle tests that made assumptions about middleware name.
(backport) No need for global flag