Fixes #195.
Fix unit tests