Attempt to fix #86773 and #86633

The rationale behind this change is explained in the RT tickets 

https://rt.cpan.org/Public/Bug/Display.html?id=86633

and

https://rt.cpan.org/Public/Bug/Display.html?id=86773

No existing test appears to break.

Best wishes