Correctly handle multiple insertions and retractions of equal facts.