Backport #1104