Fixed small bug when writing 3D array in xsf file.