Fixed #1024
Merge pull request #1039 from umpirsky/fix/issue-1024

Fixed #1024