Fix var type inference2

Giving it another try.
These are standard cells, and most of them are generated during kompilation.That's why, if I don't find a declared sort ( if sort == null) I'm skipping to the default.