Graph id fix and destructor gives better error message when tdt/core fails