Thanks Baptiste Mispelon for the report and Preston Holmes for the review. Backport of 2390fe3f from master.