Debug InitBuffer (add an index parameter)
was using index -1 of an array