Change ex_len to pre_len in add_rule().