Fixed bug to and from agents not set when creating event to produce resource.