Fix too big buffer returned bug