Thanks Sylvain Garancher for the report and Veranika Sabiashchanskaya for the initial patch. Backport of b16b1249 from master.