bug fix in compile_top/compile_prog

prog_to_i3 needs the original next_global, not the new one from
prog_to_i1 (that one can be ignored).