Backport #625