Several fixes and minor improvements

Here are several fixes and improvements I found myself making, in migrating our tickets.

I can split these up into individual pull requests if you prefer, of course, but all of these seem fairly uncontroversial so I thought I'd just submit them in one go, and only split them up if you do turn out to prefer that.