Plug a few potential memory leaks