Addressing PR comments on Agent, misc fixes to concurrency issues