Some minor code cleanups and documentation.