Plug memory leaks.