tetra/main: Prevent double-joins