Fix some formatting, grammar and style issues and add a couple of missing comments.