misc bug fix