Fix 2D array allocation.