Some bugs fixed in the agent install script. Tested.