Handle mysterious duplicates when adding rules
Merge branch 'dev'