See my comment two diffs above (`related.py:L148-163`).