minor aesthetic changes

This commit fixes typos in a few comments, and improves readability in
a few spots (without changing functionality).