Index: src/Actions/PotentialAction/FitCompoundPotentialAction.cpp
===================================================================
--- src/Actions/PotentialAction/FitCompoundPotentialAction.cpp	(revision e63edb93a800204ca8a32bfc45eed103c7679210)
+++ src/Actions/PotentialAction/FitCompoundPotentialAction.cpp	(revision b40690bfddf335b2e572dfb6c23adfe8588d60ed)
@@ -96,4 +96,5 @@
       graph,
       params.training_file.get(),
+      params.max_iterations.get(),
       params.threshold.get(),
       params.best_of_howmany.get());
Index: src/Actions/PotentialAction/FitCompoundPotentialAction.def
===================================================================
--- src/Actions/PotentialAction/FitCompoundPotentialAction.def	(revision e63edb93a800204ca8a32bfc45eed103c7679210)
+++ src/Actions/PotentialAction/FitCompoundPotentialAction.def	(revision b40690bfddf335b2e572dfb6c23adfe8588d60ed)
@@ -23,14 +23,15 @@
 // ValueStorage by the token "Z" -> first column: int, Z, "Z"
 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
-#define paramtypes (boost::filesystem::path)(std::vector<const element *>)(unsigned int)(double)
-#define paramtokens ("training-file")("fragment-charges")("take-best-of")("set-threshold")
-#define paramdescriptions ("optional file to write training data to")("charges specifying the fragment")("take the best among this many approximations")("Require L2 error to be smaller than threshold, overrides number of attempts")
-#define paramdefaults (PARAM_DEFAULT(""))(NOPARAM_DEFAULT)(PARAM_DEFAULT(3))(PARAM_DEFAULT(1.))
-#define paramreferences (training_file)(fragment)(best_of_howmany)(threshold)
+#define paramtypes (boost::filesystem::path)(std::vector<const element *>)(unsigned int)(double)(unsigned int)
+#define paramtokens ("training-file")("fragment-charges")("take-best-of")("set-threshold")("set-max-iterations")
+#define paramdescriptions ("optional file to write training data to")("charges specifying the fragment")("take the best among this many approximations")("Require L2 error to be smaller than threshold, overrides number of attempts")("sets the maximum number of iterations spent on the optimization of parameters")
+#define paramdefaults (PARAM_DEFAULT(""))(NOPARAM_DEFAULT)(PARAM_DEFAULT(3))(PARAM_DEFAULT(1.))(PARAM_DEFAULT(100))
+#define paramreferences (training_file)(fragment)(best_of_howmany)(threshold)(max_iterations)
 #define paramvalids \
 (DummyValidator<boost::filesystem::path>()) \
 (STLVectorValidator< std::vector<const element *> >(1,99, ElementValidator())) \
 (PositiveValidator<unsigned int>()) \
-(PositiveValidator<double>())
+(PositiveValidator<double>()) \
+(PositiveValidator<unsigned int>())
 
 #undef statetypes
Index: src/Actions/PotentialAction/FitPotentialAction.cpp
===================================================================
--- src/Actions/PotentialAction/FitPotentialAction.cpp	(revision e63edb93a800204ca8a32bfc45eed103c7679210)
+++ src/Actions/PotentialAction/FitPotentialAction.cpp	(revision b40690bfddf335b2e572dfb6c23adfe8588d60ed)
@@ -147,4 +147,5 @@
       graph,
       params.training_file.get(),
+      params.max_iterations.get(),
       params.threshold.get(),
       params.best_of_howmany.get());
Index: src/Actions/PotentialAction/FitPotentialAction.def
===================================================================
--- src/Actions/PotentialAction/FitPotentialAction.def	(revision e63edb93a800204ca8a32bfc45eed103c7679210)
+++ src/Actions/PotentialAction/FitPotentialAction.def	(revision b40690bfddf335b2e572dfb6c23adfe8588d60ed)
@@ -23,9 +23,9 @@
 // ValueStorage by the token "Z" -> first column: int, Z, "Z"
 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
-#define paramtypes (boost::filesystem::path)(std::string)(std::vector<const element *>)(std::vector<const element *>)(unsigned int)(double)
-#define paramtokens ("training-file")("potential-type")("potential-charges")("fragment-charges")("take-best-of")("set-threshold")
-#define paramdescriptions ("optional file to write training data to")("potential type to fit")("charges specifying the potential")("charges specifying the fragment")("take the best among this many approximations")("Require L2 error to be smaller than threshold, overrides number of attempts")
-#define paramdefaults (PARAM_DEFAULT(""))(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(3))(PARAM_DEFAULT(1.))
-#define paramreferences (training_file)(potentialtype)(charges)(fragment)(best_of_howmany)(threshold)
+#define paramtypes (boost::filesystem::path)(std::string)(std::vector<const element *>)(std::vector<const element *>)(unsigned int)(double)(unsigned int)
+#define paramtokens ("training-file")("potential-type")("potential-charges")("fragment-charges")("take-best-of")("set-threshold")("set-max-iterations")
+#define paramdescriptions ("optional file to write training data to")("potential type to fit")("charges specifying the potential")("charges specifying the fragment")("take the best among this many approximations")("Require L2 error to be smaller than threshold, overrides number of attempts")("sets the maximum number of iterations spent on the optimization of parameters")
+#define paramdefaults (PARAM_DEFAULT(""))(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(3))(PARAM_DEFAULT(1.))(PARAM_DEFAULT(100))
+#define paramreferences (training_file)(potentialtype)(charges)(fragment)(best_of_howmany)(threshold)(max_iterations)
 #define paramvalids \
 (DummyValidator<boost::filesystem::path>()) \
@@ -34,5 +34,6 @@
 (STLVectorValidator< std::vector<const element *> >(1,99, ElementValidator())) \
 (PositiveValidator<unsigned int>()) \
-(PositiveValidator<double>())
+(PositiveValidator<double>()) \
+(PositiveValidator<unsigned int>())
 
 #undef statetypes
