Fixed re-allocation bug in MultiDimGrid