Sneaky bug: Through the pointer in the Agent and the caching within the
State, the agent could be kept alive through a deleteAgent() call.
Agents are tough to kill!
Minor changes to facilitate debugging