Various little fixes and tweaks