Destructor and sanity check