Correct a bug in dim2multidim