Fix two bugs. "i is undeclared" and "multidimensional array must have bounds for all dimensions except the first"