Added tests and updated the test coverage