TRQ-2290. Fix a memory leak and some of the unintialized reads reported, even though it would seem that all of the uninitialized read complaints are red herrings.