Fix typed self-join