Typos

After finding a typo in a log message, I used a spellchecker to go through the string constants in the source code and fix the obvious typos I found. In the process, I found similar typos also in the actual code.
There are several patches in this pull request:
- The first is only about string constants and comments.
- The following commits touch code. I tried to group the changes so that each commit is valid for itself. You will want to cherrypick patches from this set.