Backport #892 to the `v1.x` branch
Backport #892 to the
v1.xbranch