Fix not resetting agent state when creating children.