diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp
index 222db70d2bb2ac4109e637058ed0d48f7cf454dc..4ee10837b6b06bedad0ef282a272261ca6ee9799 100755
--- a/indra/llui/llstatbar.cpp
+++ b/indra/llui/llstatbar.cpp
@@ -62,7 +62,7 @@ F32 calc_tick_value(F32 min, F32 max)
 	{
 		S32 divisor = DIVISORS[divisor_idx];
 		F32 possible_tick_value = range / divisor;
-		S32 num_whole_digits = llceil(logf(min + possible_tick_value) * OO_LN10);
+		S32 num_whole_digits = llceil(logf(llabs(min + possible_tick_value)) * OO_LN10);
 		for (S32 digit_count = -(num_whole_digits - 1); digit_count < 6; digit_count++)
 		{
 			F32 test_tick_value = min + (possible_tick_value * pow(10.0, digit_count));
@@ -681,8 +681,8 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
 
 	// start counting from actual min, not current, animating min, so that ticks don't float between numbers
 	// ensure ticks always hit 0
-	S32 last_tick = 0;
-	S32 last_label = 0;
+	S32 last_tick = S32_MIN;
+	S32 last_label = S32_MIN;
 	if (mTickValue > 0.f && value_scale > 0.f)
 	{
 		const S32 MIN_TICK_SPACING  = mOrientation == HORIZONTAL ? 20 : 30;
@@ -697,7 +697,7 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
 		{
 			const S32 begin = llfloor((tick_value - mCurMinBar)*value_scale);
 			const S32 end = begin + TICK_WIDTH;
-			if (begin - last_tick < MIN_TICK_SPACING)
+			if (begin < last_tick + MIN_TICK_SPACING)
 			{
 				continue;
 			}
@@ -712,7 +712,7 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
 
 			if (mOrientation == HORIZONTAL)
 			{
-				if (begin - last_label > MIN_LABEL_SPACING)
+				if (begin > last_label + MIN_LABEL_SPACING)
 				{
 					gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight - TICK_LENGTH, begin, LLColor4(1.f, 1.f, 1.f, 0.25f));
 					LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, bar_rect.mRight, begin,
@@ -727,7 +727,7 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
 			}
 			else
 			{
-				if (begin - last_label > MIN_LABEL_SPACING)
+				if (begin > last_label + MIN_LABEL_SPACING)
 				{
 					gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.25f));
 					LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, begin - 1, bar_rect.mBottom - TICK_LENGTH,
diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp
index 2af7a7d35db8d46972f8f4c0cf76ae23237fea40..9b57246ea1324b4316dbebf9ed9de4a908589eab 100755
--- a/indra/llvfs/llvfile.cpp
+++ b/indra/llvfs/llvfile.cpp
@@ -137,12 +137,12 @@ U8* LLVFile::readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S
 	}
 	else
 	{		
-		data = (U8*) ll_aligned_malloc_16(file_size);
+		data = (U8*) ll_aligned_malloc(16, file_size);
 		file.read(data, file_size);	/* Flawfinder: ignore */ 
 		
 		if (file.getLastBytesRead() != (S32)file_size)
 		{
-			ll_aligned_free(data);
+			ll_aligned_free(16, data);
 			data = NULL;
 			file_size = 0;
 		}
diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp
index adcecbbb7a647a53141a37cacc09c7bee721ac7c..b7fff6cae37fb380520149930ab82766ee22ca34 100755
--- a/indra/newview/llfloaterjoystick.cpp
+++ b/indra/newview/llfloaterjoystick.cpp
@@ -42,20 +42,20 @@
 #include "llviewerjoystick.h"
 #include "llcheckboxctrl.h"
 
-static LLTrace::SampleStatHandle<>	sJoystickAxis1("Joystick axis 1"),
+static LLTrace::SampleStatHandle<>	sJoystickAxis0("Joystick axis 0"),
+									sJoystickAxis1("Joystick axis 1"),
 									sJoystickAxis2("Joystick axis 2"),
 									sJoystickAxis3("Joystick axis 3"),
 									sJoystickAxis4("Joystick axis 4"),
-									sJoystickAxis5("Joystick axis 5"),
-									sJoystickAxis6("Joystick axis 6");
+									sJoystickAxis5("Joystick axis 5");
 static LLTrace::SampleStatHandle<>* sJoystickAxes[6] = 
 {
+	&sJoystickAxis0,
 	&sJoystickAxis1,
 	&sJoystickAxis2,
 	&sJoystickAxis3,
 	&sJoystickAxis4,
-	&sJoystickAxis5,
-	&sJoystickAxis6
+	&sJoystickAxis5
 };
 
 LLFloaterJoystick::LLFloaterJoystick(const LLSD& data)
diff --git a/indra/newview/skins/default/xui/en/floater_joystick.xml b/indra/newview/skins/default/xui/en/floater_joystick.xml
index 59f6a9434c4ac5661411b878b34c9874b0b2c765..ca165d1a29a9d3ceaaa440d534e13a9fbd81f19f 100755
--- a/indra/newview/skins/default/xui/en/floater_joystick.xml
+++ b/indra/newview/skins/default/xui/en/floater_joystick.xml
@@ -208,6 +208,7 @@
         <stat_bar
          bar_max="2"
          bar_min="-2"
+				 show_bar="true"
          height="0"
          label="Axis 0"
          label_spacing="1"
@@ -220,6 +221,7 @@
         <stat_bar
          bar_max="2"
          bar_min="-2"
+				 show_bar="true"
          label="Axis 1"
          label_spacing="1"
          layout="topleft"
@@ -228,6 +230,7 @@
         <stat_bar
          bar_max="2"
          bar_min="-2"
+				 show_bar="true"
          label="Axis 2"
          label_spacing="1"
          layout="topleft"
@@ -236,6 +239,7 @@
         <stat_bar
          bar_max="2"
          bar_min="-2"
+				 show_bar="true"
          label="Axis 3"
          label_spacing="1"
          layout="topleft"
@@ -244,6 +248,7 @@
         <stat_bar
          bar_max="2"
          bar_min="-2"
+				 show_bar="true"
          label="Axis 4"
          label_spacing="1"
          layout="topleft"