Misc cleanup and bug fixes.
Minor edit.
Yet another minor edit.