Thanks homm for the report and Aramgutang and lrekucki for work on the patch. Backport of f19a3669 from master