Fix issue #8941
Merge pull request #8944 from olliewalsh/issue_8941

Fix issue #8941