Fixed #798
Merge pull request #844 from dvvrd/fix798

Fixed #798