Some minor fixes and tweaks