Corrected problems related to destructor change