Bugfixes, typos, and small improvements.

These are just changes that I'm pretty sure aren't going to be controversial. There is actually one feature addition (the "black market" flag), but it isn't used in any of the commits in this pull request.