minor bug fixes and tweaks.