some more bug fixes and tweaks