diff --git a/source/SkyXEngine.h b/source/SkyXEngine.h
index d6f33fc97332e5b71de92f025f4fff6d2d4bc86a..3742b5f91bfe56f6b01fd4e47565c4e1fb71d9d8 100644
--- a/source/SkyXEngine.h
+++ b/source/SkyXEngine.h
@@ -292,7 +292,7 @@ QT стиль документирования (!) и QT_AUTOBRIEF - корот
 #ifndef __SKYXENGINE_H
 #define __SKYXENGINE_H
 
-#define SKYXENGINE_VERSION "X.3.1-dev"
+#define SKYXENGINE_VERSION "X.3.2-dev"
 
 #define SKYXENGINE_VERSION4EDITORS "SkyXEngine version " ## SKYXENGINE_VERSION
 
diff --git a/source/gui/Font.cpp b/source/gui/Font.cpp
index f31d86fb315962df46c4a73d2b3d9efac12a30d6..dc644df648e4a28299157fb0814a8d49699a8be9 100644
--- a/source/gui/Font.cpp
+++ b/source/gui/Font.cpp
@@ -17,6 +17,8 @@ namespace gui
 				{
 					UINT db = (dstheight - posY - y) * dstwidth * bpp + (posX + x) * bpp + c;
 					UINT sb = (srcheight - y - 1) * srcwidth * bpp + x * bpp + c;
+					assert(db < (UINT)(dstwidth * dstheight * 4));
+					assert(sb < (UINT)(srcwidth * srcheight * 4));
 					dst[db] = max(src[sb], dst[db]);
 					if((dstheight - posY - y) * dstwidth * bpp + (posX + x) * bpp + c >= dstwidth * dstheight * bpp)
 					{
@@ -187,6 +189,7 @@ namespace gui
 
 	void CFont::regen()
 	{
+		printf("_heapchk() = %d\n", _heapchk());
 		for(UINT i = 0; i < m_vpTextures.size(); i++)
 		{
 			CTextureManager::unloadTexture(m_vpTextures[i]);
@@ -286,6 +289,7 @@ namespace gui
 						d.data[cc] = (cr + cg + cb) / 3;
 						//d.data[cc] = 255;
 						cc++;
+						assert(cc <= d.w * d.h * 4);
 					}
 				}
 			}
@@ -306,6 +310,7 @@ namespace gui
 						d.data[cc] = c;
 						//d.data[cc] = 255;
 						cc++;
+						assert(cc <= d.w * d.h * 4);
 					}
 				}
 			}
@@ -398,6 +403,8 @@ namespace gui
 
 		printf("%dx%d\n", width, height);
 
+		printf("_heapchk() = %d\n", _heapchk());
+
 		byte * image = new byte[width*height * 4];
 		memset(image, 0, sizeof(byte)* width*height * 4);
 
@@ -514,6 +521,8 @@ namespace gui
 			mem_delete_a(newImage);
 		}
 
+		printf("_heapchk() = %d\n", _heapchk());
+
 		CTexture * tex = CTextureManager::createTexture(StringW(L"!") + m_szFontName + L"_" + StringW((int)m_iFontSize) + L"+" + StringW((int)m_style) + L"-" + StringW(m_iBlurRadius) + L"#" + StringW((int)(m_vpTextures.size() - 1)), width, height, 4, false, image);
 		//SX_SAFE_DELETE_A(image);
 		for(UINT i = 0; i < list.size(); i++)
@@ -529,6 +538,10 @@ namespace gui
 		save(); // TODO: Find better place to call that
 
 		// TODO: Add rebuild handler to call Layout on the document
+
+
+		printf("_heapchk() = %d\n", _heapchk());
+
 	}
 
 	bool CFont::place(Array<chardata> &list, int width, int height)