Squash and cherry-pick PR #4811 #4731
Merge pull request #5381 from openscholar/4731-hotfix1

Squash and cherry-pick PR #4811 #4731