Misc cleanup and documentation.