Fix 3D packing bug