Fix a bug in byte consumption.