General code cleanup and documentation tweaks.