Destructor corrected, memory allocation corrected