Backported fix for bug #62852