Index: cpp/frams/genetics/fH/fH_general.cpp
===================================================================
--- cpp/frams/genetics/fH/fH_general.cpp	(revision 1298)
+++ cpp/frams/genetics/fH/fH_general.cpp	(revision 1299)
@@ -352,5 +352,5 @@
 	}
 
-	unsigned int stickscount = children->size() + 1;
+	size_t stickscount = children->size() + 1;
 
 	MultiRange ranges;
@@ -469,5 +469,5 @@
 	// next stick is selected by minimum distance between first vector of its handle
 	// and second vector of any existing StickHandle in body
-	int remaining = sticks.size() - 2;
+	int remaining = int(sticks.size()) - 2;
 	while (remaining > 0)
 	{
@@ -880,5 +880,5 @@
 int fH_Builder::removeNeuronsWithInvalidClasses()
 {
-	int count = neurons.size();
+	int count = (int)neurons.size();
 	if (count == 0)
 	{
@@ -913,5 +913,5 @@
 
 	}
-	return count - neurons.size();
+	return count - (int)neurons.size();
 }
 
Index: cpp/frams/genetics/fH/fH_oper.cpp
===================================================================
--- cpp/frams/genetics/fH/fH_oper.cpp	(revision 1298)
+++ cpp/frams/genetics/fH/fH_oper.cpp	(revision 1299)
@@ -237,5 +237,5 @@
 
 	// used for computing chg
-	unsigned int sumgenes = creature->sticks.size() + creature->neurons.size() + creature->connections.size();
+	size_t sumgenes = creature->sticks.size() + creature->neurons.size() + creature->connections.size();
 
 	// if there is only one element in genotype (stick), then deletion would end
@@ -401,11 +401,11 @@
 unsigned int Geno_fH::getRandomHandle(fH_Builder *creature, fH_Handle *&handle, ParamEntry *&tab, bool skipalonestick)
 {
-	unsigned int allhandlescount = creature->connections.size() + creature->neurons.size();
+	size_t allhandlescount = creature->connections.size() + creature->neurons.size();
 	if (!skipalonestick || creature->sticks.size() > 1)
 	{
 		allhandlescount += creature->sticks.size();
 	}
-	unsigned int toselect = rndUint(allhandlescount);
-	if (toselect < creature->connections.size())
+	int toselect = rndUint(allhandlescount);
+	if ((size_t)toselect < creature->connections.size())
 	{
 		handle = creature->connections[toselect];
@@ -413,14 +413,18 @@
 		return toselect;
 	}
-	else if (toselect - creature->connections.size() < creature->neurons.size())
-	{
-		toselect -= creature->connections.size();
+	else if (toselect - (int)creature->connections.size() < (int)creature->neurons.size())
+	{
+		toselect -= (int)creature->connections.size();
 		handle = creature->neurons[toselect];
 		tab = creature->neuronparamtab;
+		if (toselect < 0)
+			logMessage("Geno_fH", "getRandomHandle", LOG_CRITICAL, "toselect<0");
 		return toselect;
 	}
-	toselect -= creature->connections.size() + creature->neurons.size();
+	toselect -= int(creature->connections.size() + creature->neurons.size());
 	handle = creature->sticks[toselect];
 	tab = creature->stickparamtab;
+	if (toselect < 0)
+		logMessage("Geno_fH", "getRandomHandle", LOG_CRITICAL, "toselect<0");
 	return toselect;
 }
Index: cpp/frams/genetics/fL/fL_matheval.cpp
===================================================================
--- cpp/frams/genetics/fL/fL_matheval.cpp	(revision 1298)
+++ cpp/frams/genetics/fL/fL_matheval.cpp	(revision 1299)
@@ -648,9 +648,9 @@
 	if (type == 0)
 	{
-		count = operatorstrings.size();
+		count = int(operatorstrings.size());
 	}
 	else if (type == 2)
 	{
-		count = operatorstrings.size() - arithmeticoperatorscount;
+		count = int(operatorstrings.size()) - arithmeticoperatorscount;
 	}
 	randop += rndUint(count);
@@ -662,5 +662,5 @@
 	if (varcount > 0)
 	{
-		int currsize = postfixlist.size();
+		size_t currsize = postfixlist.size();
 		int varid = rndUint(varcount);
 		postfixlist.push_back(vars[varid]);
@@ -704,5 +704,5 @@
 		std::list<Token *>::iterator it = postfixlist.begin();
 		// insertion can be applied from 1st occurrence
-		int insertlocation = 1 + rndUint(postfixlist.size() - 1);
+		int insertlocation = 1 + rndUint((int)postfixlist.size() - 1);
 		std::advance(it, insertlocation);
 		Operator *rndop;
