Merge pull request #47 from sklyarov-ivan/issue38

Issue38
Merge pull request #48 from sklyarov-ivan/issue39

Issue39
#merge with master