minor change to buf->head and tail

the first deposited element is now on position 0 (previously it was 1)