update documentation and fix tests