Various improvements

Forgot to add topic branches to split these into separate pull requests.