Plug memory leaks

One of them was preexisting.