Updating a term reference programatically
You're one level off; this:

$node-&gt;computed_file_extension[$node-&gt;language][0] = $term-&gt;tid;


Needs to be this:

$node-&gt;computed_file_extension[$node-&gt;language][0]['tid'] = $term-&gt;tid;


Without specifying the field column (tid in this case), Drupal doesn't know which DB field the data should be stored in.