Merge changes from PR #1286 from master into 3.8.14.1 branch.