diff --git a/harmonicmaps.cc b/harmonicmaps.cc
index eacb9927fb3657c1b237c20ce7154b911bd187d8..b5348540031c1a9c18594973117cf85ba8219ee5 100644
--- a/harmonicmaps.cc
+++ b/harmonicmaps.cc
@@ -37,19 +37,19 @@ const int dim = 3;
 
 // Image space of the geodesic fe functions
 #ifdef ROTATION2
-typedef Rotation<2,double> TargetSpace;
+typedef Rotation<double,2> TargetSpace;
 #endif
 #ifdef ROTATION3
-typedef Rotation<3,double> TargetSpace;
+typedef Rotation<double,2> TargetSpace;
 #endif
 #ifdef UNITVECTOR2
-typedef UnitVector<2> TargetSpace;
+typedef UnitVector<double,2> TargetSpace;
 #endif
 #ifdef UNITVECTOR3
-typedef UnitVector<3> TargetSpace;
+typedef UnitVector<double,3> TargetSpace;
 #endif
 #ifdef REALTUPLE1
-typedef RealTuple<1> TargetSpace;
+typedef RealTuple<double,1> TargetSpace;
 #endif
 
 // Tangent vector of the image space