NULLing pointers on cleanup