Fix premature removal of nodes in DynTSP