Minor Clean on Agent and more global variables