Fix an out of bounds array access bug in test.c