Fixed #520
Merge pull request #765 from dvvrd/fix520

Fixed #520