misc bug fixes!