Added tests and code coverage