 				tx = tangentsData.readFloat();
 				ty = tangentsData.readFloat();
 				tz = tangentsData.readFloat();
-				mag = Math.sqrt(tx * tx + ty * ty + tz * tz);
+				
+				var mag : Number = Math.sqrt(tx * tx + ty * ty + tz * tz);
 				
 				if (mag != 0.)
 				{

				tangentsData.position = ii;
				var tx2 : Number = tx + tangentsData.readFloat();
				var ty2 : Number = ty + tangentsData.readFloat();
				var tz2 : Number = ty + tangentsData.readFloat();
				
				tangentsData.position = ii;
				tangentsData.writeFloat(tx2);

				var tx 	: Number 	= coef * (v1v2 * (x0 - x2) - v0v2 * (x1 - x2));
				var ty 	: Number 	= coef * (v1v2 * (y0 - y2) - v0v2 * (y1 - y2));
				var tz 	: Number 	= coef * (v1v2 * (z0 - z2) - v0v2 * (z1 - z2));
				
				ii = i0 * tangentsVertexSize + tangentsOffset;
				tangentsData.position = ii;
				var tx0 : Number = tx + tangentsData.readFloat();
				var ty0 : Number = ty + tangentsData.readFloat();
				var tz0 : Number = tz + tangentsData.readFloat();
				
				tangentsData.position = ii;
				tangentsData.writeFloat(tx0);
