Cleaning up null-pointer-deallocation warnings.
Merge pull request #1386 from csimons/cleanup-null-pointer-deallocation-warnings

Cleaning up null-pointer-deallocation warnings.