miscellaneous fixes

This is a shared branch containing improvements too small for individual PRs.

Feel free to push to it. It'll be merged before the end of the week.
not sure what the best path is, but this `var log = pkg.Logger(..)` thing isn't adding much