Thanks Stefan Koegl for the report and Simon Charette for the review. Backport of b9c8bbf37 from master.