minor tweaks, some minor bugs too