change some joins to left outer join where fields were optional