Update documentation and fix a memory leak.