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: 
       Note that "z" has the default priority 100.
    */
    filterOverrides = defs:
      let
        defaultPrio = 100;
        getPrio = def: if def.value._type or "" == "override" then def.value.priority else defaultPrio;
        highestPrio = foldl' (prio: def: min (getPrio def) prio) 9999 defs;
        strip = def: if def.value._type or "" == "override" then def // { value = def.value.content; } else def;
      in concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
  
    /* Sort a list of properties.  The sort priority of a property is
       1000 by default, but can be overridden by wrapping the property
  
negative.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:
  