update documentation and minor bug fixes