Fixing error in AgentStartError.
Fixing waitService to consider the maximum number of attempts