diff --git a/src/cosserat-continuum.cc b/src/cosserat-continuum.cc
index 11f955310f748faa42ff38e175cd8814f611430a..eef6a5a8319e119c693b829966b394299811e44d 100644
--- a/src/cosserat-continuum.cc
+++ b/src/cosserat-continuum.cc
@@ -468,7 +468,7 @@ int main (int argc, char *argv[]) try
         BlockVector<FieldMatrix<double,3,3> > dOV;
         Dune::Functions::interpolate(orientationPowerBasis, dOV, orientationDirichletValues);
     
-        for (int i = 0; i < compositeBasis.size({0}); i++) {
+        for (std::size_t i = 0; i < compositeBasis.size({0}); i++) {
             FieldVector<double,3> x0i = x[_0][i].globalCoordinates();
             for (int j=0; j<3; j++) {
                 if (deformationDirichletDofs[i][j])
@@ -523,7 +523,7 @@ int main (int argc, char *argv[]) try
             //Therefore, x and the dirichletDofs are converted to a RigidBodyMotion structure, as well as the Hessian and Gradient that are returned by the assembler
             std::vector<TargetSpace> xTargetSpace(compositeBasis.size({0}));
             BitSetVector<TargetSpace::TangentVector::dimension> dirichletDofsTargetSpace(compositeBasis.size({0}), false);
-            for (int i = 0; i < compositeBasis.size({0}); i++) {
+            for (std::size_t i = 0; i < compositeBasis.size({0}); i++) {
               for (int j = 0; j < 3; j ++) { // Displacement part
                 xTargetSpace[i].r[j] = x[_0][i][j];
                 dirichletDofsTargetSpace[i][j] = deformationDirichletDofs[i][j];
@@ -570,7 +570,7 @@ int main (int argc, char *argv[]) try
                 solver.solve();
                 xTargetSpace = solver.getSol();
             }
-            for (int i = 0; i < xTargetSpace.size(); i++) {
+            for (std::size_t i = 0; i < xTargetSpace.size(); i++) {
               x[_0][i] = xTargetSpace[i].r;
               x[_1][i] = xTargetSpace[i].q;
             }
diff --git a/test/nonplanarcosseratenergytest.cc b/test/nonplanarcosseratenergytest.cc
index a8dd5a48caab554d4ba4ada8da0f7e7cfc6a82b1..20f181f72157b1fe13647acb54a72c9ea4b8f272 100644
--- a/test/nonplanarcosseratenergytest.cc
+++ b/test/nonplanarcosseratenergytest.cc
@@ -101,7 +101,7 @@ double calculateEnergy(const int numLevels, const F1 referenceConfigurationFunct
 
     BlockVector<FieldVector<double,3> > helperVector2(feBasis.size());
     Dune::Functions::interpolate(deformationPowerBasis, helperVector2, configurationFunction);
-    for (int i = 0; i < feBasis.size(); i++) {
+    for (std::size_t i = 0; i < feBasis.size(); i++) {
         for (int j = 0; j < dimworld; j++)
             sol[i].r[j] = helperVector2[i][j];