Fix to correctly check for duplicated rules in case of "-1" rules