Lots of minor improvements