Fix - corrected boundary of index in loop.