various minor fixes and tweaks