Simple bugfixes, typos, cleanup, etc

These are just changes that I'm sure won't be controversial or problematic in any way. Just occasional stuff I've corrected on a whip.