Fix integer overflows in recovery procedure. am: 1273956e69 am: 5978a71d29 am: 877dcba47a am: f4ee1720f3 am: cae056f219 am: 682d691052 am: ae68f02272 am: a3604da6e1 am: 089fe38ac5
am: 71c06eb1f7

* commit '71c06eb1f733b4afed3698566477a97487ed22aa':
  Fix integer overflows in recovery procedure.