Refactoring and bugfixing
Merge pull request #81 from mkalb/littleFixes

Refactoring and bugfixing