Fix 3D arrays