Simple bugfixes, typos, cleanup, etc

These are just changes that I'm sure won't be controversial or problematic in any way.