Backport fix for #114