Fixed a bug of add_rule().