Merge "Fix overflow issue when computing ideal size of scratch partition"