Added test coverage, fixed docs