minor fixes in the agent