More changes to Agent code