Fix ticket #40942 also in unreleased gaw3 port.