Fix code; fix spelling, etc; improve wording

A sloppy omnibus patch which:

  * Fixes two or three apparent code errors;
  * Fixes spelling errors;
  * Adds capitalisation in a number of places;
  * Fixes or improves the wording in a few places.