Make it behave correctly when there are more than two tables being joined, also. Update regression test expected outputs.