Cleanup of transport code in agent.