implement equals() and hashCode() for filters to prevent them from building up in sets. Also, NPE check in RelationshipUtils.targets().