Fix var type inference2

Giving it another try.
see previous comment about this case