Fixing up some memory leakage that's been reported. Still some more to track down.