closed #1010
fix #1010 #950
Merge pull request #104 from yupe/master

UPD: merge with yupe/master