Add unit tests
Fix unit tests