Fix var type inference2

Giving it another try.
Okay if you're making changes to this pull request based on planned changes in another pull request, I either need to see that pull request or you need to explain to me in detail the plan you have made for this part of the code base that has you making these steps.