Updated query builder for joins.
Update form behaviour.