Formatting fixes and minor bug fixes.