fix issue #772
Merge pull request #816 from UncleBill/master

Fix issue #772