Fixed some handling of nested related object referencing and implicit joins