Misc bug fixes and updates