anchor.diff:  %% Note that these are all from the erlang module; suitable functions in other
   %% modules could fail due to the module not being loaded.
   types(erlang, 'map_size', [_]) ->
  -    sub_safe(#t_integer{}, [#t_map{}]);
  -types(erlang, 'tuple_size', [_]) ->
  -    sub_safe(#t_integer{}, [#t_tuple{}]);
  +    sub_safe(#t_integer{elements={0,?SIZE_UPPER_LIMIT}}, [#t_map{}]);
  +types(erlang, 'tuple_size', [Src]) ->
  +    Min = case Src of
  +              #t_tuple{size=Sz} -> Sz;
  +              _ -> 0
  +          end,
  +    Max = (1 bsl 24) - 1,                       %Documented max size of a tuple.
  +    sub_safe(#t_integer{elements={Min,Max}}, [#t_tuple{}]);
   types(erlang, 'bit_size', [_]) ->
  -    sub_safe(#t_integer{}, [#t_bitstring{}]);
  +    sub_safe(#t_integer{elements={0,?SIZE_UPPER_LIMIT}}, [#t_bitstring{}]);
   types(erlang, 'byte_size', [_]) ->
  -    sub_safe(#t_integer{}, [#t_bitstring{}]);
  +    sub_safe(#t_integer{elements={0,?SIZE_UPPER_LIMIT}}, [#t_bitstring{}]);
   types(erlang, hd, [Src]) ->
       RetType = erlang_hd_type(Src),
       sub_safe(RetType, [#t_cons{}]);
  
positive.code: %% Bitwise ops
  types(erlang, 'band', [_,_]=Args) ->
      sub_unsafe(erlang_band_type(Args), [#t_integer{}, #t_integer{}]);
  types(erlang, 'bor', [_,_]) ->
      sub_unsafe(#t_integer{}, [#t_integer{}, #t_integer{}]);
  types(erlang, 'bxor', [_,_]) ->
      sub_unsafe(#t_integer{}, [#t_integer{}, #t_integer{}]);
  types(erlang, 'bsl', [_,_]) ->
      sub_unsafe(#t_integer{}, [#t_integer{}, #t_integer{}]);
  types(erlang, 'bsr', [_,_]) ->
      sub_unsafe(#t_integer{}, [#t_integer{}, #t_integer{}]);
  types(erlang, 'bnot', [_]) ->
      sub_unsafe(#t_integer{}, [#t_integer{}]);
  
  
negative.code:             beam_types:meet(LHS, #t_integer{})
      end.
  
  erlang_bor_type([#t_integer{elements={Int,Int}}, RHS]) when is_integer(Int) ->
      erlang_bor_type_1(RHS, Int);
  erlang_bor_type([LHS, #t_integer{elements={Int,Int}}]) when is_integer(Int) ->
      erlang_bor_type_1(LHS, Int);
  erlang_bor_type(_) ->
      #t_integer{}.
  
  erlang_bor_type_1(LHS, Int) ->
      case LHS of
          #t_integer{elements={Min0,Max0}} when Min0 >= 0, Max0 - Min0 < 1 bsl 256 ->
              {_Intersection, Union} = range_masks(Min0, Max0),
  
              Min = max(Min0, Int),
              Max = Union bor Int,
  
              #t_integer{elements={Min,Max}};
          _ ->
              beam_types:meet(LHS, #t_integer{})
      end.
  
  erlang_map_get_type(Key, Map) ->
      case Map of
          #t_map{super_key=SKey,super_value=SValue} ->
  