Fix var type inference2

Giving it another try.
Cool... didn't know about getChildSort.