anchor.diff:          ) defs;
   
           # Process mkOverride properties.
  -        defs'' = filterOverrides defs';
  +        defs'' = filterOverrides' defs';
   
           # Sort mkOrder properties.
           defs''' =
             # Avoid sorting if we don't have to.
  -          if any (def: def.value._type or "" == "order") defs''
  -          then sortProperties defs''
  -          else defs'';
  -      in defs''';
  +          if any (def: def.value._type or "" == "order") defs''.values
  +          then sortProperties defs''.values
  +          else defs''.values;
  +      in {
  +        values = defs''';
  +        inherit (defs'') highestPrio;
  +      };
  +
  +    defsFinal = defsFinal'.values;
   
       # Type-check the remaining definitions, and merge them.
       mergedValue = foldl' (res: def:
  
positive.code: 
    # Merge definitions of a value of a given type.
    mergeDefinitions = loc: type: defs: rec {
      defsFinal =
        let
          # Process mkMerge and mkIf properties.
          defs' = concatMap (m:
  
negative.code: 
      in opt //
        { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
          inherit (res.defsFinal') highestPrio;
          definitions = map (def: def.value) res.defsFinal;
          files = map (def: def.file) res.defsFinal;
          inherit (res) isDefined;
  