Thanks Víðir Valberg Guðmundsson for the report and Tim Graham for the review. Backport of 460ec09d2e from master.
460ec09d2e
Thanks Hourann Bosci for the patch.