Fixed error with connection timeout calculation