Backport #1094