Merge pull request #6828 from charris/backport-6827

Backport 6827