Add tests for joins
Fix test