Bunch of minor fixes/cleanup