Fix Issue 10647
Merge branch 'master' into issue10647
Add unittest
Merge pull request #1414 from tom-tan/issue10647

Fix Issue 10647