Misc cleanups, simplifications, style, and doc fixes.