Index: cpp/frams/genetics/fH/fH_general.cpp
===================================================================
--- cpp/frams/genetics/fH/fH_general.cpp	(revision 965)
+++ cpp/frams/genetics/fH/fH_general.cpp	(revision 966)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -10,6 +10,5 @@
 #include "fH_general.h"
 
-using namespace std;
-#undef max //this macro is not needed here and it clashes with numeric_limits<>::max()
+using std::pair, std::to_string, std::numeric_limits;
 
 
@@ -603,5 +602,5 @@
 			}
 		}
-		// if there was no neuron that could begin connection, then return warning
+		// if there was no neuron that could begin a connection, then return warning
 		if (!beginneu)
 		{
@@ -649,15 +648,15 @@
 Pt3D fH_Builder::getNextDirection(int count, int number)
 {
-	// In order to get evenly distributed sticks coming from the same Part method
-	// uses algorithm for even distribution of points on a sphere. There are several
-	// methods to perform this, usually they are iterative. This method introduced
+	// In order to get evenly distributed sticks coming from the same Part, the method
+	// uses an algorithm for even distribution of points on a sphere. There are several
+	// methods to perform this, usually iterative. The method introduced
 	// below offers not fully accurate, yet quite satisfying results. This is
-	// RSZ method (Rakhmanov, Saff and Zhou method), with use of the golden angle.
-	// This method is based on distribution of points along spiral that covers sphere
-	// surface.
-
-	// Following method works partially on spherical coordinates (r and theta is used).
+	// the RSZ method (Rakhmanov, Saff and Zhou) with the use of the golden angle.
+	// This method is based on the distribution of points along a spiral that covers
+	// the sphere surface.
+
+	// The following method works partially on spherical coordinates (r and theta is used).
 	// The Z coordinate is from Cartesian coordinate system. The golden angle is used
-	// to "iterate" along spiral, while Z coordinate is used to move down the
+	// to "iterate" along the spiral, while the Z coordinate is used to move down the
 	// sphere.
 
Index: cpp/frams/genetics/fH/fH_general.h
===================================================================
--- cpp/frams/genetics/fH/fH_general.h	(revision 965)
+++ cpp/frams/genetics/fH/fH_general.h	(revision 966)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -39,5 +39,5 @@
 
 /**
- * Base class for all kinds of handles in fH encoding.Each line of fH genotype
+ * Base class for all kinds of handles in fH encoding. Each line of fH genotype
  * describes a handle. Handles can be divided into joints, neurons and
  * connections. Every handle is described with 2 vectors of 'dimensions' values.
@@ -292,6 +292,6 @@
 
 	/**
-	 * Processes single line of genotype. This line should begin with
-	 * "j:", "n:" or "c:". Otherwise it will be considered as error.
+	 * Processes a single line of genotype. This line should begin with
+	 * "j:", "n:" or "c:". Otherwise it will be considered an error.
 	 * @param line line of a genotype
 	 * @param linenumber number of line in genotype, required for error messages
Index: cpp/frams/genetics/genman.cpp
===================================================================
--- cpp/frams/genetics/genman.cpp	(revision 965)
+++ cpp/frams/genetics/genman.cpp	(revision 966)
@@ -572,4 +572,5 @@
 	delete[] styletab;
 	latex += "}"; //for color (it was used at least once)
+	if (style & GENSTYLE_INVALID) latex += "}";
 	if (style & GENSTYLE_BOLD) latex += "}";
 	if (style & GENSTYLE_ITALIC) latex += "}";
