Fix scheduling $agents to $agent.