Fix docs and unit tests