Fix to ensure `for` actually names middleware.

Bug from previous refactor. Test changed to ensure it gets caught.