Fixing a potential reference error in `run()` if `next()` is executed from a middleware, and there is nothing else in queue