Backport fix for #207