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

fixes by issue #125d