Backport fix for #11151