Fix RAM in the multidimensional case