Minor fixes

This is a set of non-functional fixes that all of Oliver's other contributions depend on and I think it makes sense to merge these early so that other feature branches are easier to compare.