 				else
 					result = compileFunctionCall(new CompiledConstant(OPERATOR_PREFIX + '?:', operators['?:']), [condition, trueBranch, falseBranch]);
 				
-				tokens.splice(left - 1, right - left + 3, result);
+				tokens.splice(left - 1, end - left + 1, result);
 			}
 			// stop if any branch operators remain
 			if (Math.max(tokens.indexOf('?'), tokens.indexOf(':')) >= 0)

		private function compileTokens(tokens:Array):ICompiledObject
		{
			var i:int;
			var subArray:Array;
			var compiledParams:Array;
			var open:int;
			var close:int;
			
			// first step: compile quoted Strings and Numbers
			for (i = 0; i < tokens.length; i++)

					continue;
				}
				
				if (leftBracket == '(' && compiledToken) // if there is a compiled token to the left, this is a function call
				{
					if (debug)
						trace("compiling function call", decompileObject(compiledToken));
					
					// the token to the left is the method
					// replace the function token, '(', and ')' tokens with a compiled function call
					tokens.splice(open - 1, 3, compileFunctionCall(compiledToken, compiledParams));
					continue;
				}
				else // '{' or '(' group that does not correspond to a function call
				{
					if (compiledParams.length == 0)
						throw new Error("Missing expression inside '" + leftBracket + rightBracket + "'");
					
					var op:String = leftBracket == '(' ? ',' : '{}';
					
					if (compiledParams.length == 1) // single command
						tokens.splice(open, 2, compiledParams[0]);
					else // multiple commands
						tokens.splice(open, 2, compileOperator(op, compiledParams));
					continue;
				}
				
				break;
