anchor.diff:              then setFlag publishUpdates entity world
               else world
   
  -        static member internal trySetFacetNames facetNames entityState entityOpt world =
  +        static member internal trySetFacetNames facetNames entityState entity world =
               let intrinsicFacetNames = World.getEntityIntrinsicFacetNames entityState
               let extrinsicFacetNames = Set.fold (flip Set.remove) facetNames intrinsicFacetNames
               let facetNamesToRemove = Set.difference entityState.FacetNames extrinsicFacetNames
               let facetNamesToAdd = Set.difference extrinsicFacetNames entityState.FacetNames
  -            match World.tryRemoveFacets facetNamesToRemove entityState entityOpt world with
  -            | Right (entityState, world) -> World.tryAddFacets facetNamesToAdd entityState entityOpt world
  +            match World.tryRemoveFacets facetNamesToRemove entityState entity world with
  +            | Right (entityState, world) -> World.tryAddFacets facetNamesToAdd entityState entity world
               | Left _ as left -> left
   
  -        static member internal trySynchronizeFacetsToNames oldFacetNames entityState entityOpt world =
  +        static member internal trySynchronizeFacetsToNames oldFacetNames entityState entity world =
               let facetNamesToRemove = Set.difference oldFacetNames entityState.FacetNames
               let facetNamesToAdd = Set.difference entityState.FacetNames oldFacetNames
  -            match World.tryRemoveFacets facetNamesToRemove entityState entityOpt world with
  -            | Right (entityState, world) -> World.tryAddFacets facetNamesToAdd entityState entityOpt world
  +            match World.tryRemoveFacets facetNamesToRemove entityState entity world with
  +            | Right (entityState, world) -> World.tryAddFacets facetNamesToAdd entityState entity world
               | Left _ as left -> left
   
           static member internal attachIntrinsicFacetsViaNames entityState world =
  
positive.code:         /// Try to set the entity's facet names.
          static member trySetEntityFacetNames facetNames entity world =
              let entityState = World.getEntityState entity world
              match World.trySetFacetNames facetNames entityState (Some entity) world with
              | Right (entityState, world) ->
                  let oldWorld = world
                  let oldEntityState = entityState
  
negative.code:                             entityState
                          else { entityState with FacetNames = facetNames; FacetsNp = facets }
                      let entityState = Reflection.attachProperties EntityState.copy facet entityState
                      let oldWorld = world
                      let oldEntityState = entityState
                      let oldOmnipresent = oldEntityState.Omnipresent
                      let oldViewType = oldEntityState.ViewType
                      let oldBoundsMax = World.getEntityStateBoundsMax oldEntityState
                      let world = World.setEntityState entityState entity world
                      let world = World.updateEntityInEntityTree oldOmnipresent oldViewType oldBoundsMax entity oldWorld world
                      let world = World.withEventContext (fun world -> facet.Register (entity, world)) entity world
                      Right (World.getEntityState entity world, world)
                  else let _ = World.choose world in Left ("Facet '" + getTypeName facet + "' is incompatible with entity '" + scstring entityState.Name + "'.")
              | Left error -> Left error
  
          static member private tryRemoveFacets facetNamesToRemove entityState entity world =
              Set.fold
                  (fun eitherEntityWorld facetName ->
                      match eitherEntityWorld with
                      | Right (entityState, world) -> World.tryRemoveFacet facetName entityState entity world
                      | Left _ as left -> left)
                  (Right (entityState, world))
                  facetNamesToRemove
  
          static member private tryAddFacets facetNamesToAdd entityState entity world =
              Set.fold
                  (fun eitherEntityStateWorld facetName ->
                      match eitherEntityStateWorld with
                      | Right (entityState, world) -> World.tryAddFacet facetName entityState entity world
                      | Left _ as left -> left)
                  (Right (entityState, world))
                  facetNamesToAdd
  