Fix debug build memory leaks.