Various tweaks and minor fixes