That's never a problem because the lowest value is MIN (which is 1) and the highest 127, and the array is 0 to 128. But even if that is a problem it doesn't matter because the first code works and the second is the same but with external ram and it doesn't work.
So array edges are not the problem because it worked fine the first time.