Updated documentation, minor code cleanup.