Minor bug fixes and formatting tweaks.