Backport #1099