Fixed attempting to delete nullptrs