Formatting updates and bug fixes.

Updated code formatting to match prior formatting, and misc other fixes on the way to regaining some of the old style (but with a fresh new look).