fixed memory leaks in unit tests.
tweaks to destructor order.
all tests passing again.