Thanks Michael Manfre for the report and initial patch and Tobias McNulty for the review. Backport of 79dd751b from master.