more typechecker improvements