docs: function do_conform(args, opts) {
  	function prettify(e) {
  		var msg = ""+e;
  		if(e.fileName) {
  			msg += " [" + e.fileName;
  			if(e.lineNumber) {
  				msg += ":" + e.lineNumber;
  			}
  			msg += "]";
  		}
  		if (e.stack) {
  			msg += '\n====== stack ======\n';
  			msg += e.stack + "\n";
  		}
  		return msg;
  	}
  	var arg, fn, validate, opts_max_length, defaults_direction;
  	try {
  		args = Array.prototype.slice.call(args);
  
  		opts = opts || {};
  		validate = opts.validate || [];
  		opts_max_length = opts.max || args.length;
  		defaults_direction = opts.defaults || 'left';
  		
  		opts.type = opts.type || 'basic';
  		
  		if(opts.length) {
  			opts.min = opts.length;
  			opts.max = opts.length;
  		}
  
  		if(!opts.min) {
  			opts.min = 0;
  		}
  		
  		// First priority to search for the callback function
  		if(opts.type === 'async') {
  			(function(){
  				if(args.length < 1) {
  					return;
  				}
  				var i = args.length - 1;
  				for(; i >= 0; i -= 1) {
  					if(!mod.isFunction(args[i])) {
  						//throw new TypeError("Last argument is not valid function!");
  						return;
  					}
  					fn = args[i];
  					return;
  				}
  			}());
  		}
  		
  		// Pad args from left (with undefined) if the direction to set defaults is from right
  		if( opts.max && (defaults_direction === 'right') ) {
  			while(args.length < opts.max) {
  				args.unshift(undefined);
  			}
  		}
  		
  		// Create default error handler if fn is undefined
  		if( (opts.type === 'async') && (!mod.isFunction(fn)) ) {
  			throw new TypeError("No callback function");
  		}
  		
  		// Check states
  
  		/*
  		if(args.length < 1) {
  			throw new TypeError("No callback function found!");
  		}
  		*/
  		
  		if(opts.min && (args.length < opts.min) ) {
  			throw new TypeError("Not enough arguments!");
  		}
  		
  		if(opts.max && (args.length > opts.max) ) {
  			throw new TypeError("Too many arguments!");
  		}
  		
  		// Check validate
  		if(!(validate instanceof Array)) {
  			throw new TypeError("opts.validate must be an Array!");
  		} else if(validate.length !== 0) {
  			(function(){
  				var i = 0;
  				
  				function do_loop(){
  					var result, msgs = [];
  					result = mod.validate(args[i], validate[i]);
  					if(!result.valid) {
  						foreach(result.errors).each(function(p) {
  							msgs.push( ((p.property !== undefined) ? 'property="' + p.property : '') + '", ' + p.message );
  						});
  						throw new TypeError("Argument #" + i + " was invalid: " + msgs.join('; ') + " (schema was " + debug_stringify(validate[i]) + ")");
  					}
  				}
  				
  				// Check args with each schema from validate
  				for(; i < validate.length; i += 1) {
  					do_loop();
  				}
  			}());
  		}
  		
  		return args;
  	} catch(e) {
  		if(mod.isFunction(fn)) {
  			fn(prettify(e));
  		} else {
  			throw e;
  		}
  	}
  }