Added some unit tests
Code review comments