Minor bug fixes and formatting fixes.