Fix global state bug in Type instances