Fixed #796
Merge pull request #823 from dvvrd/fix796

Fixed #796