Backport PR 3726