Fix memory leaks (introduce/call destructors)