Earlier I had added a line to set a variable's id if output if a variable.
It was probably a mistake, which I'm fixing now by testing whether output
is a cdms2 object so it's ok to set its id.