Minor edits to scan_for_agents.