Fixed #1022
Merge pull request #1025 from dvvrd/fix1022

Fixed #1022