Bug fix and fix up documentation.