Clean up a few potential memleaks.