diff --git a/src/Trim.cpp b/src/Trim.cpp
index 8b2d544d303306b27c7db8a4de04bf8d31f87a42..733987ff6956069cf043d3389e6854da5536b736 100644
--- a/src/Trim.cpp
+++ b/src/Trim.cpp
@@ -195,7 +195,7 @@ int main (int argc, char const* argv[])
 		 solver = new FGNelderMead(trimmer,initialGuess,
 			lowerBound, upperBound, initialStepSize,iterMax,rtol,
 			abstol,speed,showConvergeStatus,showSimplex,pause,&callback);
-		 while(solver->status()) solver->update();
+		 while(solver->status()==1) solver->update();
 	}
 	catch (const std::runtime_error & e)
 	{
diff --git a/src/math/FGNelderMead.cpp b/src/math/FGNelderMead.cpp
index f48a209bbef3bf2e516aaeb0f1185fe9b6beac73..f62a3a8831d11d039effa29f80126ad4e8f93303 100644
--- a/src/math/FGNelderMead.cpp
+++ b/src/math/FGNelderMead.cpp
@@ -108,7 +108,7 @@ void FGNelderMead::update()
 					   m_cost[m_iMin])/(std::abs(m_cost[m_iMax]+std::abs(m_cost[m_iMin])+
 												 std::numeric_limits<double>::epsilon()));
 
-	// check for max iteratin break condition
+	// check for max iteration break condition
 	if (iter > iterMax)
 	{
 		std::cout << "\nmax iterations exceeded" << std::endl;