bunch of minor fixes