Fix bug in duplicate ruleset checking