Fix unittests

Fix all failing unit tests. Fixes #118