common: Fix connecting to the agent.