Backport PR 3725