Merge pull request #90 from andriyanov/master

found some bugs