Fixed some memory leaks. Refs #8685.