Fix out-of-bounds at beg of buffer