Thanks Cristiano Coelho for the report and Tim Graham for the review. Backport of f6fefbf8 from master.