corrected / refactored / added unit tests
Merge pull request #1 from wimvds/unit-tests

corrected / refactored / added unit tests