Backport PR 3741