diff --git a/include/dephier/dephier.hpp b/include/dephier/dephier.hpp
index f3bbdad..6d21dd8 100644
--- a/include/dephier/dephier.hpp
+++ b/include/dephier/dephier.hpp
@@ -29,11 +29,12 @@ namespace richdem::dephier {
 //We use a 32-bit integer for labeling depressions. This allows for a maximum of
 //2,147,483,647 depressions. This should be enough for most practical purposes.
 typedef uint32_t dh_label_t;
-typedef uint32_t flat_c_idx;
+typedef uint64_t flat_c_idx;
 
 //Some special valuess
 const dh_label_t NO_PARENT = std::numeric_limits<dh_label_t>::max();
 const dh_label_t NO_VALUE  = std::numeric_limits<dh_label_t>::max();
+const flat_c_idx NO_CELL   = std::numeric_limits<int64_t>::max(); //Fits in int64 (read by Python)
 
 //This class holds information about a depression. Its pit cell and outlet cell
 //(in flat-index form) as well as the elevations of these cells. It also notes                                                   //what is flat-index form?
@@ -45,10 +46,10 @@ template<class elev_t>
 struct Depression {
   //Flat index of the pit cell, the lowest cell in the depression. If more than
   //one cell shares this lowest elevation, then one is arbitrarily chosen.
-  flat_c_idx pit_cell = NO_VALUE;
+  flat_c_idx pit_cell = NO_CELL;
   //Flat index of the outlet cell. If there is more than one outlet cell at this
   //cell's elevation, then one is arbitrarily chosen.
-  flat_c_idx out_cell = NO_VALUE;
+  flat_c_idx out_cell = NO_CELL;
   //Parent depression. If both this depression and its neighbour fill up, this
   //parent depression is the one which will contain the overflow.
   dh_label_t parent   = NO_PARENT;
@@ -121,7 +122,7 @@ template<class elev_t>
 struct Outlet {
   dh_label_t depa;                //Depression A
   dh_label_t depb;                //Depression B
-  flat_c_idx out_cell = NO_VALUE; //Flat-index of cell at which A and B meet.
+  flat_c_idx out_cell = NO_CELL; //Flat-index of cell at which A and B meet.
   //Elevation of the cell linking A and B
   elev_t  out_elev = std::numeric_limits<elev_t>::infinity();
 
@@ -297,8 +298,8 @@ DepressionHierarchy<elev_t> GetDepressionHierarchy(
   std::vector<flat_c_idx> ocean_seeds;
   std::vector<flat_c_idx> land_seeds;
   //Reduce reallocations by assuming 2.5% of the map is seeds
-  ocean_seeds.reserve(dem.width()*dem.height()/40);
-  land_seeds.reserve(dem.width()*dem.height()/40);
+  ocean_seeds.reserve(dem.size()/40);
+  land_seeds.reserve(dem.size()/40);
 
   #pragma omp declare reduction(merge : std::vector<flat_c_idx> : omp_out.insert(omp_out.end(), omp_in.begin(), omp_in.end()))
 
@@ -307,7 +308,7 @@ DepressionHierarchy<elev_t> GetDepressionHierarchy(
   //begin looking for depressions. We add all of these ocean cells to the
   //priority queue now.
   uint64_t ocean_cells = 0;
-  #pragma omp parallel for collapse(2) reduction(+:ocean_cells) reduction(merge:ocean_seeds)
+  #pragma omp parallel for reduction(+:ocean_cells) reduction(merge:ocean_seeds)
   for(int y=0;y<dem.height();y++)
   for(int x=0;x<dem.width();x++){
     //Ensure the input only has OCEAN and NO_DEP labels.
@@ -343,7 +344,7 @@ DepressionHierarchy<elev_t> GetDepressionHierarchy(
     //The ocean is deep
     oceandep.pit_elev = -std::numeric_limits<elev_t>::infinity();
     //It's so deep we can't find its bottom
-    oceandep.pit_cell = NO_VALUE;
+    oceandep.pit_cell = NO_CELL;
     oceandep.dep_label = 0;
   }
 
@@ -359,9 +360,9 @@ DepressionHierarchy<elev_t> GetDepressionHierarchy(
   //Drainage Direction Over Flat Surfaces") as a way of reducing the number of
   //flat cells. Regardless, the algorithm will deal gracefully with the flats it
   //finds and this shouldn't slow things down too much!
-  int pit_cell_count = 0;
+  uint64_t pit_cell_count = 0;
   progress.start(dem.size());
-  #pragma omp parallel for collapse(2) reduction(+:pit_cell_count) reduction(merge:land_seeds)
+  #pragma omp parallel for reduction(+:pit_cell_count) reduction(merge:land_seeds)
   for(int y=0;y<dem.height();y++)  //Look at all the cells
   for(int x=0;x<dem.width() ;x++){ //Yes, all of them
     ++progress;
@@ -682,7 +683,7 @@ DepressionHierarchy<elev_t> GetDepressionHierarchy(
         // continue;
 
       //Ensure we don't modify depressions that have already found their paths
-      assert(dep.out_cell==NO_VALUE);
+      assert(dep.out_cell==NO_CELL);
       assert(dep.odep==NO_VALUE);
 
       //Point this depression to the ocean through Depression B Label
@@ -743,14 +744,17 @@ DepressionHierarchy<elev_t> GetDepressionHierarchy(
   //The labels array has been modified in place. The depression hierarchy is
   //returned.
 
-  Timer timer_volumes;
-  timer_volumes.start();
-
-  CalculateMarginalVolumes(depressions, dem, label);
-
-  CalculateTotalVolumes(depressions);
-
-  RDLOG_TIME_USE<<"t Time to calculate volumes = "<<timer_volumes.stop()<<" s";
+  //Depression volumes are not computed: dep_vol is not used by database.py and
+  //CalculateMarginalVolumes climbs the hierarchy for every cell, which takes
+  //hours on a full-resolution DEM (MOLA). dep_vol stays at 0 in the output.
+  // Timer timer_volumes;
+  // timer_volumes.start();
+  //
+  // CalculateMarginalVolumes(depressions, dem, label);
+  //
+  // CalculateTotalVolumes(depressions);
+  //
+  // RDLOG_TIME_USE<<"t Time to calculate volumes = "<<timer_volumes.stop()<<" s";
   RDLOG_TIME_USE<<"t Total time in depression hierarchy calculations = "<<timer_overall.stop()<<" s";
 
   return depressions;
@@ -776,7 +780,7 @@ void CalculateMarginalVolumes(
     std::vector<double>   total_elevations(deps.size(), 0);
 
     #pragma omp for
-    for(unsigned int i=0;i<dem.size();i++){
+    for(uint64_t i=0;i<dem.size();i++){
       ++progress;
       const auto my_elev = dem(i);
       auto clabel        = label(i);
@@ -840,7 +844,7 @@ void CalculateTotalVolumes(
 //hierarchy.
 template<class elev_t>
 void LastLayer(Array2D<dh_label_t> &label, const Array2D<elev_t> &dem, const DepressionHierarchy<elev_t> &depressions){
-  #pragma omp parallel for collapse(2)
+  #pragma omp parallel for
   for(int y=0;y<label.height();y++)
   for(int x=0;x<label.width();x++){
     auto mylabel = label(x,y);
diff --git a/src/main.cpp b/src/main.cpp
index ea00f99..b36818b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -39,7 +39,7 @@ int main(int argc, char **argv){
   //Label the ocean cells. This is a precondition for using
   //`GetDepressionHierarchy()`.
   #pragma omp parallel for
-  for(unsigned int i=0;i<label.size();i++){
+  for(uint64_t i=0;i<label.size();i++){
     if(topo.isNoData(i) || topo(i)==ocean_level){ //Ocean Level is assumed to be lower than any other cells (even Death Valley)
       label(i) = dh::OCEAN;
     }
@@ -53,10 +53,10 @@ int main(int argc, char **argv){
 
   //GraphViz dot-style output for drawing depression hierarchy graphs.
   {
-    std::ofstream fgraph(out_name+"-graph.csv");
-    fgraph<<"parent,child,oceanlink\n";
+    std::ofstream fgraph(out_name+"-graph-detail.csv");
+    fgraph<<"child,parent,dep_vol,pit_cell,out_cell,out_elev,odep,geolink,oceanlink\n";
     for(unsigned int i=1;i<deps.size();i++){
-      fgraph<<deps[i].parent<<","<<i<<",";
+      fgraph<<i<<","<<deps[i].parent<<","<<deps[i].dep_vol<<","<<deps[i].pit_cell<<","<<deps[i].out_cell<<","<<deps[i].out_elev<<","<<deps[i].odep<<","<<deps[i].geolink<<",";
       //Is it an ocean link?
       fgraph<<(deps[i].parent!=dh::NO_VALUE && (deps[i].parent==dh::OCEAN || !(deps[deps[i].parent].lchild==i || deps[deps[i].parent].rchild==i)))<<"\n";
     }
diff --git a/submodules/richdem/include/richdem/common/Array2D.hpp b/submodules/richdem/include/richdem/common/Array2D.hpp
index 4cdb2f7..17e995f 100644
--- a/submodules/richdem/include/richdem/common/Array2D.hpp
+++ b/submodules/richdem/include/richdem/common/Array2D.hpp
@@ -98,7 +98,7 @@ class Array2D {
   //Using uint32_t for i-addressing allows for rasters of ~65535^2. These
   //dimensions fit easily within an int32_t xy-address.
   typedef int32_t  xy_t;            ///< xy-addressing data type
-  typedef uint32_t i_t;             ///< i-addressing data type
+  typedef uint64_t i_t;             ///< i-addressing data type
 
   static const i_t NO_I = std::numeric_limits<i_t>::max(); //TODO: What is this?
 
@@ -466,7 +466,7 @@ class Array2D {
   const T* data() const { return _data.data(); }
 
   ///@brief Number of cells in the DEM
-  i_t size() const { return view_width*view_height; }
+  i_t size() const { return (i_t)view_width*(i_t)view_height; }
 
   ///Width of the raster
   xy_t width() const { return view_width; }
@@ -491,7 +491,7 @@ class Array2D {
   ///Finds the minimum value of the raster, ignoring NoData cells
   T min() const {
     T minval = std::numeric_limits<T>::max();
-    for(unsigned int i=0;i<size();i++){
+    for(i_t i=0;i<size();i++){
       if(_data[i]==no_data)
         continue;
       minval = std::min(minval,_data[i]);
@@ -502,7 +502,7 @@ class Array2D {
   ///Finds the maximum value of the raster, ignoring NoData cells
   T max() const {
     T maxval = std::numeric_limits<T>::min();
-    for(unsigned int i=0;i<size();i++){
+    for(i_t i=0;i<size();i++){
       if(_data[i]==no_data)
         continue;
       maxval = std::max(maxval,_data[i]);
@@ -518,7 +518,7 @@ class Array2D {
     @param[in] newval   Value to replace 'oldval' with
   */
   void replace(const T oldval, const T newval){
-    for(unsigned int i=0;i<size();i++)
+    for(i_t i=0;i<size();i++)
       if(_data[i]==oldval)
         _data[i] = newval;
   }
@@ -535,7 +535,7 @@ class Array2D {
   i_t countval(const T val) const {
     //TODO: Warn if raster is empty?
     i_t count=0;
-    for(unsigned int i=0;i<size();i++)
+    for(i_t i=0;i<size();i++)
       if(_data[i]==val)
         count++;
     return count;
@@ -715,7 +715,7 @@ class Array2D {
   */
   void transpose(){
     RDLOG_WARN<<"transpose() is an experimental feature.";
-    std::vector<T> new_data(view_width*view_height);
+    std::vector<T> new_data((i_t)view_width*view_height);
     for(xy_t y=0;y<view_height;y++)
     for(xy_t x=0;x<view_width;x++)
       std::swap(_data[(i_t)x*(i_t)view_height+(i_t)y], _data[xyToI(x,y)]);
@@ -895,7 +895,7 @@ class Array2D {
   */
   void countDataCells() const {
     num_data_cells = 0;
-    for(unsigned int i=0;i<size();i++)
+    for(i_t i=0;i<size();i++)
       if(_data[i]!=no_data)
         num_data_cells++;
   }
diff --git a/submodules/richdem/include/richdem/common/ProgressBar.hpp b/submodules/richdem/include/richdem/common/ProgressBar.hpp
index 34cf6b2..5d6f264 100644
--- a/submodules/richdem/include/richdem/common/ProgressBar.hpp
+++ b/submodules/richdem/include/richdem/common/ProgressBar.hpp
@@ -38,10 +38,10 @@ namespace richdem {
 ///of the progress bar is shown in ProgressBar.hpp.
 class ProgressBar{
   private:
-    uint32_t total_work_;    ///< Total work to be accomplished
-    uint32_t next_update;   ///< Next point to update the visible progress bar
-    uint32_t call_diff;     ///< Interval between updates in work units
-    uint32_t work_done;
+    uint64_t total_work_;    ///< Total work to be accomplished
+    uint64_t next_update;   ///< Next point to update the visible progress bar
+    uint64_t call_diff;     ///< Interval between updates in work units
+    uint64_t work_done;
     uint16_t old_percent;   ///< Old percentage value (aka: should we update the progress bar) TODO: Maybe that we do not need this
     Timer    timer;         ///< Used for generating ETA
 
@@ -69,7 +69,7 @@ class ProgressBar{
   public:
     ///@brief Start/reset the progress bar.
     ///@param total_work  The amount of work to be completed, usually specified in cells.
-    void start(uint32_t total_work){
+    void start(uint64_t total_work){
       timer = Timer();
       timer.start();
       total_work_ = total_work;
@@ -84,7 +84,7 @@ class ProgressBar{
     ///
     ///Define the global `RICHDEM_NO_PROGRESS` flag to prevent this from having
     ///an effect. Doing so may speed up the program's execution.
-    void update(uint32_t work_done0){
+    void update(uint64_t work_done0){
       #ifdef RICHDEM_NO_PROGRESS
         return;
       #endif
@@ -138,7 +138,7 @@ class ProgressBar{
       return timer.accumulated();
     }
 
-    uint32_t cellsProcessed() const {
+    uint64_t cellsProcessed() const {
       return work_done;
     }
 };
