Backport #7682