Merge pull request #2 from gi0baro/master

Bugfixes and tests