Added formatting for code.

Also fixed a typo.
More formatting and minor typo fixes.