This has Jani's suggestions fixed, along with a couple of other trivial patches. I'll mark them ready at this point.