 				
 				if (value < _minimum[ii])
 				{
-					_minimum[i] = value;
-					minMaxChanged = true;
+					_minimum[ii] = value;
+					_boundsHaveChanged = true;
 				}
 				else if (value > _maximum[ii])
 				{
-					_maximum[i] = value;
-					minMaxChanged = true;
+					_maximum[ii] = value;
+					_boundsHaveChanged = true;
 				}
 				
 				_data.push(value);
 			}
 
-			if (_locked)
-			{
-				_invalidMinMax = minMaxChanged;
-			}
-			else
+			if (!_locked)
 			{
 				_changed.execute(this, null);
-				if (minMaxChanged)
+				
+				if (_boundsHaveChanged)
+				{
+					_boundsHaveChanged = false;
 					_boundsChanged.execute(this);
+				}
 			}
 		}
 

		{
			return _maximum[index];
		}

		public function set(i : int, value : Number) : void
		{
			var minMaxChanged	: Boolean	= false;
			
			checkWriteUsage(this);
			
			_data[i] = value;
			
			i %= _format.dwordsPerVertex;
			if (value < _minimum[i])
			{
				_minimum[i] = value;
				minMaxChanged = true;
			}
			else if (value > _maximum[i])
			{
				_maximum[i] = value;
				minMaxChanged = true;
			}
			
			if (_locked)
			{
				_invalidMinMax = minMaxChanged;
			}
			else
			{
				_changed.execute(this, null);
				if (minMaxChanged)
					_boundsChanged.execute(this);
			}
		}
		
		public function lock() : Vector.<Number>
		{
			if (_locked) 

			return _data;
		}
		
		/**
		 * Unlock the stream to reactivate signals. The VertexStream.changed signal
		 * is always executed when this method is called. The VertexStream.boundsChanged
		 * signal is called only if the bounds of the stream actually changed.
		 * 
		 */
		public function unlock() : void
		{
			if (!_locked)
