Fix and test type stability of var