Backport #2919