This commit mostly avoids following 'loop back' ID pointers, since those should never define an actual relationship.