Misc cleanup and documentation