A few misc bug fixes.