Apro_gen: _gen_runner. terminate conditions improved