Fix issue #791
Merge pull request #817 from cristianoc72/issue-791

Fix issue #791