Remove both match and target contexts after a rule is done.