Your comments

Sorry - previous bug test case was wrong, trying this instead reproduces the bug.
out << ind << dotID() << "->" << _arg[i]->dotID() << ";" << endl;