Add Term.replaceAt (not sure why it didn't exist).