anchor.diff:              %% Not a record type, or ill-formed record type.
               {app_t, Ann, Id, unfold_types_in_type(Args, Options)}
       end;
  -unfold_types_in_type(Type={id, _, RecName}, Options) ->
  +unfold_types_in_type(Id, Options) when ?is_type_id(Id) ->
       %% Like the case above, but for types without parameters.
       UnfoldRecords = proplists:get_value(unfold_record_types, Options, false),
  -    case lookup_type(RecName) of
  +    case lookup_type(Id) of
           {[], {record_t, Fields}} when UnfoldRecords ->
               {record_t, unfold_types_in_type(Fields, Options)};
           {[], {alias_t, Type1}} ->
               unfold_types_in_type(Type1, Options);
           _ ->
               %% Not a record type, or ill-formed record type
  -            Type
  +            Id
       end;
   unfold_types_in_type({field_t, Attr, Name, Type}, Options) ->
       {field_t, Attr, Name, unfold_types_in_type(Type, Options)};
  
positive.code:     true;
  unify1({id, _, Name}, {id, _, Name}, _When) ->
      true;
  unify1({fun_t, _, Args1, Result1}, {fun_t, _, Args2, Result2}, When) ->
      unify(Args1, Args2, When) andalso unify(Result1, Result2, When);
  unify1({app_t, _, {id, _, F}, Args1}, {app_t, _, {id, _, F}, Args2}, When)
  
negative.code: unfold_types_in_type(T) ->
      unfold_types_in_type(T, []).
  
  unfold_types_in_type({app_t, Ann, Id, Args}, Options) when ?is_type_id(Id) ->
      UnfoldRecords = proplists:get_value(unfold_record_types, Options, false),
      case lookup_type(Id) of
          {Formals, {record_t, Fields}} when UnfoldRecords, length(Formals) == length(Args) ->
              {record_t,
               unfold_types_in_type(
  