Backport #1734