Thanks Tim Graham for the report Backport of c75dd664cf from master
c75dd664cf
Backport of 4d92a0bd86 from master.
4d92a0bd86