Fix the wrong timeout calculation.