type system changes, other fixes