anchor.diff:          %%     A JSON boolean. 
           <<"boolean">> ->
               boolean();
  +
  +
  +
  +
           %% integer
           %%     A JSON number without a fraction or exponent part. 
           <<"integer">> ->
  -	    MaxInt = jsonschema:keyword(Schema,"maximum"),
  -		_ExcMax = jsonschema:keyword(Schema,"exclusiveMaximum"),
  -	    MinInt = jsonschema:keyword(Schema,"minimum"),
  -   	    MultipleOf = jsonschema:keyword(Schema,"multipleOf",1),
  -	    case {MaxInt,MinInt} of
  -		{undefined,undefined} ->
  -		    ?SUCHTHAT(N,integer(),(N rem MultipleOf)==0);
  -		_ ->
  -		    ExclusiveMaximum = 
  -			jsonschema:keyword(Schema,"exclusiveMaximum",false),
  -		    Max = 
  -			if
  -			    MaxInt == undefined -> 1000000;
  -			    ExclusiveMaximum -> MaxInt-1;
  -			    true -> MaxInt
  +			
  +			MaxScanned = jsonschema:keyword(Schema,"maximum"),
  +			ExcMaxScanned = jsonschema:keyword(Schema,"exclusiveMaximum"),
  +			MinScanned = jsonschema:keyword(Schema,"minimum"),
  +			ExcMinScanned = jsonschema:keyword(Schema,"exlusiveMinimum"),
  +		   	MultipleOf = jsonschema:keyword(Schema,"multipleOf",1),
  +
  +			% Setting up keywords
  +			case {MaxScanned,ExcMaxScanned} of
  +				
  +				{undefined,undefined} ->
  +					Max = ?MAX_INT_VALUE;
  +				
  +
  +				%% There should be an error case here. Json-schema doc says that if exclusiveMaximum is present, maximum MUST be present as well
  +
  +				{undefined, true} ->
  +					Max = ?MAX_INT_VALUE - 1;
  +
  +				{MaxScanned, true} ->
  +					Max = MaxScanned -1;
  +
  +				{MaxScanned, _} ->
  +					Max = MaxScanned
  +			
   			end,
  -		    ExclusiveMinimum = 
  -			jsonschema:keyword(Schema,"exclusiveMinimum",false),
  -		    Min = 
  -			if
  -			    MinInt == undefined -> -1000000;
  -			    ExclusiveMinimum -> MinInt+1;
  -			    true -> MinInt
  +			
  +
  +
  +
  +			case {MinScanned,ExcMinScanned} of
  +				
  +				{undefined,undefined} ->
  +					Min = 0;
  +				
  +
  +				%% There should be an error case here. Json-schema doc says that if exclusiveMinimum is present, minimum MUST be present as well
  +
  +				{undefined, _} ->
  +					Min = 1;
  +
  +				{MinScanned, true} ->
  +					Min = MinScanned + 1;
  +
  +				{MinScanned, _} ->
  +					Min = MinScanned
  +			
   			end,
  -		    ?SUCHTHAT(N,eqc_gen:choose(Min,Max),(N rem MultipleOf)==0)
  -	    end;
  +
  + 
  +			%Creating the generator
  +
  +			?SUCHTHAT(Int,randInt(Min,Max), 
  +					  isMultiple(Int,MultipleOf));
  +
  +
           %% number
           %%     Any JSON number. Number includes integer.
           <<"number">> ->
  
positive.code: -define(LOG(X,Y),true).
  -endif.
  
  %% Mochijson2 should export a better type...
  -opaque json_term() :: any().
  
  
negative.code:     %% TODO: generator for array (no items)
      %% (it could be integrated in array/1)
      null().
  
  isMultiple(N,Mul) when Mul > 0 ->
  	N rem Mul == 0.
  