Improve documentation and minor fixes.