added code coverage and fixed tests