Cherry-picking pull request #3961 for 2.066.1

#3961 is a regression fix, but has not been merged to the release branch yet.