Added unit tests fixes #3