Fixed type simplification and repaired some type inference features that broke previous changes