Fix var type inference2

Giving it another try.
```
for (int i = 0; i < tc.getContents.size(); i++) {
    tc.getContents().set(i, (Term) new TypeSystemFilter2(tc.getProduction().getChildSort(i), context).visitNode(tc.getContents().get(i));
}
```