Minor fixes on the agent