Fixed #1024
Merge pull request #1160 from dvvrd/fix1024

Fixed #1024