some tweaks and minor fixes