minor tweaks to fix bugs