Fix an uninitialized value complaint and attempt to fix two memory leaks.