Another set of fixes for timeout calculation.