Joins

Minor fix and a test for joins.

NB: this also includes (by accident) the other pull request I just made.