Small bug fix, negative array index exception now avoided