Better ending conditions for rules, etc.