fixes by issue#125
Merge pull request #21 from DmitryVoskoboynikov/feature/issue-116

fixes by issue#125