Fix `buf.length`