Fix up leaky alloctions.