Fixed #776
Merge pull request #822 from dvvrd/fix776

Fixed #776