Fixed missing initialization of timeout; fixed wrong client id
calculation.