Fix joins

Issue #138