Fix issue 1003 F31
Merge pull request #1007 from Sophist-UK/fix_issue_1002_f31

Fix issue 1003 F31