Pushing PR #39

The pull request #39 contains a lot of improvements. It's being merged to branch in order to allow the stable version building.