Fix for queries using a LEFT OUTER JOIN in places they shouldn't