Added unit tests & fixed few issues find during writing tests