Add code coverage and tests