Add subtermAt and updateAt functions.