Fix RT#81237

This should fix RT#81237, although I'm not sure if it re-breaks RT#72676 (I'm not sure what to do to test it).