Fixed destructors, removed leaks, added memory test script