Avoid negative array subscript; break out of the loop if that happens.