Ported fix#10057 to master.