Backport of gh-4357
Backport of gh-4357