Removed empty queries with nullable relationship.