Fix up right join query to use a proper select and left join (less confusing), fix up getall call when getting a content type, reduce another query and include child ids in the main query.