Small bug fixes and tweaks.