more misc bug fixes