Merge pull request #9 from dmitriydzyuba/master

improvements and bugfixes
Merge remote-tracking branch 'upstream/master'