This is not the cleanest way to make it work reliably, but since this is an upstream problem, I can’t do much else.