Lots of smallish fixes/improvements