Fix adding and removing rules