Bunch of small fixes and tweaks