Fix off by one error when counting the bytes