Fixed some bugs and limitations with the Query joins.