protect against relation loops, part 2. fixes #2096