--- ptex-base.ch.orig	2010-05-22 14:23:16.000000000 +0900
+++ ptex-base.ch	2010-05-22 14:23:16.000000000 +0900
@@ -3803,7 +3803,7 @@
 var a:integer; {address of lig/kern instruction}
 @!gp,@!gq,@!p,@!r:pointer; {temporary registers for list manipulation}
 @!rr:halfword;
-begin r:=min_halfword; restart:@t@>@;@/
+begin restart:@t@>@;@/
 if (math_type(subscr(q))=empty)and(math_type(supscr(q))=empty)and@|
 ((math_type(nucleus(q))=math_char)or(math_type(nucleus(q))=math_jchar)) then
   begin p:=link(q);
@@ -3843,7 +3843,7 @@
          if op_byte(cur_i)<kern_flag then
            begin gp:=font_glue[cur_f]; rr:=rem_byte(cur_i);
            if gp<>null then begin
-             while((type(gp)<>r)and(link(gp)<>null)) do begin gp:=link(gp);
+             while((type(gp)<>rr)and(link(gp)<>null)) do begin gp:=link(gp);
                end;
              gq:=glue_ptr(gp);
              end
@@ -3851,7 +3851,7 @@
              font_glue[cur_f]:=gp; gq:=null;
              end;
            if gq=null then
-             begin type(gp):=r; gq:=new_spec(zero_glue); glue_ptr(gp):=gq;
+             begin type(gp):=rr; gq:=new_spec(zero_glue); glue_ptr(gp):=gq;
              a:=exten_base[cur_f]+qi((qo(rr))*3); width(gq):=font_info[a].sc;
              stretch(gq):=font_info[a+1].sc; shrink(gq):=font_info[a+2].sc;
              add_glue_ref(gq); link(gp):=get_node(small_node_size);
@@ -5713,7 +5713,8 @@
 space_factor:=1000; unsave;
 end
 @y
-begin if direction=dir_tate then disp:=axis_height(text_size) else disp:=0;
+begin if direction=dir_tate then disp:=t_baseline_shift
+      else disp:=y_baseline_shift;
 @<Append |disp_node| at begin of displace area@>;
 tail_append(new_math(math_surround,before));
 cur_mlist:=p; cur_style:=text_style; mlist_penalties:=(mode>0); mlist_to_hlist;
