fixed some bugs
Merge pull request #16 from mkotov/master

fixed some bugs