Add a fix for RT #121622.

This is strongly inspired by the corresponding bit in moar.