small fixes from a dead pull request

These are a couple of things that were included in #1455. That whole thing will need to be revisited later, but these fixes are mostly unrelated and can go now.