diff --git a/ProcessLib/HydroMechanics/HydroMechanicsFEM.h b/ProcessLib/HydroMechanics/HydroMechanicsFEM.h
index 00da123f9aba0d585eeb6a032a99bf4a34967e90..a439d753902b66c6f8e784400efe79993dbadeda 100644
--- a/ProcessLib/HydroMechanics/HydroMechanicsFEM.h
+++ b/ProcessLib/HydroMechanics/HydroMechanicsFEM.h
@@ -499,7 +499,7 @@ public:
         auto const local_x = current_solution.get(indices);
 
         cache.clear();
-        auto cache_vec = MathLib::createZeroedMatrix<Eigen::Matrix<
+        auto cache_matrix = MathLib::createZeroedMatrix<Eigen::Matrix<
             double, DisplacementDim, Eigen::Dynamic, Eigen::RowMajor>>(
             cache, DisplacementDim, num_intpts);
 
@@ -510,8 +510,6 @@ public:
             Eigen::Map<typename ShapeMatricesTypePressure::template VectorType<
                 pressure_size> const>(local_x.data() + pressure_index,
                                       pressure_size);
-        using GlobalDimVectorType =
-            typename ShapeMatricesTypePressure::GlobalDimVectorType;
 
         unsigned const n_integration_points =
             _integration_method.getNumberOfPoints();
@@ -529,7 +527,7 @@ public:
 
             // Compute the velocity
             auto const& dNdx_p = _ip_data[ip].dNdx_p;
-            cache_vec.col(ip).noalias() =
+            cache_matrix.col(ip).noalias() =
                 -K_over_mu * dNdx_p * p - K_over_mu * rho_fr * b;
         }
 
diff --git a/ProcessLib/HydroMechanics/HydroMechanicsProcess-impl.h b/ProcessLib/HydroMechanics/HydroMechanicsProcess-impl.h
index 40d1565e622eba6439beb9de21a1b3ded2c22e9c..37f1ee599b92b100b8c6631c77eae89cc0f0c94b 100644
--- a/ProcessLib/HydroMechanics/HydroMechanicsProcess-impl.h
+++ b/ProcessLib/HydroMechanics/HydroMechanicsProcess-impl.h
@@ -166,7 +166,7 @@ void HydroMechanicsProcess<DisplacementDim>::initializeConcreteProcess(
     Base::_secondary_variables.addSecondaryVariable(
         "velocity",
         makeExtrapolator(
-            1, getExtrapolator(), _local_assemblers,
+            mesh.getDimension(), getExtrapolator(), _local_assemblers,
             &LocalAssemblerInterface::getIntPtDarcyVelocity));
 }