Fix some crashes due to recent memory leak fixes (argh!!)