Fixed off-by-one in buffer printing