Added fix where incoming entities are deleted instead of outgoing entities.