Merge "Fix rounding bug and off-by-one bug for resize scripts of test samples."