Add unit tests
Fix unit test