Fix array access bug I recently introduced