Random improvements

@adamsutton @ksooo could you take a look? This is some stuff that I did some time ago but forgot to publish. None of it is really necessary but IMO it makes things a bit leaner.