Fix typos in comments and strings

Other than the typos I refrained from making stylistic changes. In some cases I reformulated the comments but only to increase readability (which is of course subjective).