Backport #1073