Fix bug in pointer deletion by initializing value to nullptr.