Code cleanup and documentation updates.