Cherry pick fix for #179