diff --git a/src/localgeodesicfestiffness.hh b/src/localgeodesicfestiffness.hh
index cb7b3d9efa08e1e18d7c6a7cecc19f4122922e54..198b052eb0a6495b3b71ff86fd9b847d907ef8da 100644
--- a/src/localgeodesicfestiffness.hh
+++ b/src/localgeodesicfestiffness.hh
@@ -87,8 +87,8 @@ public:
 
     /** \brief Assemble the element gradient of the energy functional */
     virtual void assembleGradient(const Entity& element,
-                          const std::vector<TargetSpace>& solution,
-                          Dune::array<Dune::FieldVector<double,blocksize>, 2>& gradient) const;
+                                  const std::vector<TargetSpace>& solution,
+                                  std::vector<Dune::FieldVector<double,blocksize> >& gradient) const;
     
 };
 
@@ -96,7 +96,7 @@ template <class GridView, class TargetSpace>
 void LocalGeodesicFEStiffness<GridView, TargetSpace>::
 assembleGradient(const Entity& element,
                  const std::vector<TargetSpace>& localSolution,
-                 Dune::array<Dune::FieldVector<double,blocksize>, 2>& localGradient) const
+                 std::vector<Dune::FieldVector<double,blocksize> >& localGradient) const
 {
     // ///////////////////////////////////////////////////////////
     //   Compute gradient by finite-difference approximation
@@ -104,6 +104,8 @@ assembleGradient(const Entity& element,
 
     double eps = 1e-6;
 
+    localGradient.resize(localSolution.size());
+
     std::vector<TargetSpace> forwardSolution = localSolution;
     std::vector<TargetSpace> backwardSolution = localSolution;
 
diff --git a/src/rodassembler.cc b/src/rodassembler.cc
index f177ae4b4e992b04a129e8b12f1d4af769008c07..3ab8a6dba641eb72912312eedd99e5ad103bbae6 100644
--- a/src/rodassembler.cc
+++ b/src/rodassembler.cc
@@ -152,7 +152,7 @@ assembleGradient(const std::vector<RigidBodyMotion<3> >& sol,
             localReferenceConfiguration[i] = referenceConfiguration_[indexSet.subIndex(*it,i,gridDim)];
 
         // Assemble local gradient
-        array<FieldVector<double,blocksize>, nDofs> localGradient;
+        std::vector<FieldVector<double,blocksize> > localGradient(nDofs);
 
         localStiffness.localReferenceConfiguration_ = localReferenceConfiguration;
         localStiffness.assembleGradient(*it, localSolution, localGradient);
diff --git a/src/rodlocalstiffness.hh b/src/rodlocalstiffness.hh
index 84e61ce4abd999797fa4203c65ec0ad4777e0c71..4582b7646153b0bbc9978e9a02ee0e101c7598ee 100644
--- a/src/rodlocalstiffness.hh
+++ b/src/rodlocalstiffness.hh
@@ -89,7 +89,7 @@ public:
     /** \brief Assemble the element gradient of the energy functional */
     void assembleGradient(const Entity& element,
                           const std::vector<RigidBodyMotion<3> >& solution,
-                          Dune::array<Dune::FieldVector<double,6>, 2>& gradient) const;
+                          std::vector<Dune::FieldVector<double,6> >& gradient) const;
     
     template <class T>
     static Dune::FieldVector<T,3> darboux(const Rotation<3,T>& q, const Dune::FieldVector<T,4>& q_s) 
@@ -458,7 +458,7 @@ template <class GridType, class RT>
 void RodLocalStiffness<GridType, RT>::
 assembleGradient(const Entity& element,
                  const std::vector<RigidBodyMotion<3> >& solution,
-                 Dune::array<Dune::FieldVector<double,6>, 2>& gradient) const
+                 std::vector<Dune::FieldVector<double,6> >& gradient) const
 {
     using namespace Dune;
 
@@ -468,6 +468,7 @@ assembleGradient(const Entity& element,
     const int numOfBaseFct = baseSet.size();  
         
     // init
+    gradient.resize(numOfBaseFct);
     for (size_t i=0; i<gradient.size(); i++)
         gradient[i] = 0;