Pointer decrement logic (small change)

Change the pointer decrement logic to always keep it
within the range of the array.