Fix loop that ran off the end of an array