Check for bad pointers when cleaning up.