Fix agent compilation issues