Merge pull request #9 from kreczko/master

Fixes for issues #4 and #8 + other stuff