Fixed a bug where a pointer was not initialized and was tried to be deleted.