Set pointers to NULL after deallocations