Fix join table references