Various tweaks for bugs