Several fixes to prevent infinite loops during circularity checking and finding client objects.