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

fixed some bugs