fixed tests and added code coverage