Backport #539