NEST: more fixes to infer(). Does not work yet