Fix Joins

This fixes joins in distributed mode.