Corrected comparisons of a ReferenceSlot with the external object. Must
not use UUID equality, because a published UUID doesn't equal the
external object's UUID. Use instanceof operator instead.