some type system fixes