isDead() in Agent, main improved;