Fixed the termination rule.