Unit test coverage

Almost 100% now