Agent startup/update script improved.