Works around the issue originally described in #5907 (that was then hijacked to describe the broader issue it exposes).