Added codecoverage and updated tests