Fix bugs of rule_exists?