diff --git a/modules/Bio/EnsEMBL/Hive/Utils/Graph.pm b/modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
index c8c45dacb08f3229eabc33d4a19173a942aaeae2..5a25381fc6e7c78cee05e54996e540dc79b615ad 100644
--- a/modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
+++ b/modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
@@ -186,12 +186,20 @@ sub build {
             if(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Analysis')) {
                 $target_object->{'_inflow_count'}++;
             }
-        } elsif( $df_rule->to_analysis->isa('Bio::EnsEMBL::Hive::Analysis') ) { # dataflow target is a foreign Analysis
-            $target_object = $df_rule->to_analysis();
-            $target_object->{'_foreign'}=1;
-            Bio::EnsEMBL::Hive::Analysis->collection()->add( $target_object );  # add it to the collection
-            my $foreign_stats = $target_object->stats or die "Could not fetch foreign stats for ".$target_object->display_name( $self->hive_dba );
-            Bio::EnsEMBL::Hive::AnalysisStats->collection()->add( $foreign_stats ); # add it to the collection
+        } else {
+            $target_object = $df_rule->to_analysis
+                or die "Could not fetch a target object for url='".$df_rule->to_analysis_url."', please check your database for consistency.\n";
+
+            if( UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Analysis') ) { # dataflow target is a foreign Analysis
+                $target_object->{'_foreign'}=1;
+                Bio::EnsEMBL::Hive::Analysis->collection()->add( $target_object );  # add it to the collection
+                my $foreign_stats = $target_object->stats or die "Could not fetch foreign stats for ".$target_object->display_name( $self->hive_dba );
+                Bio::EnsEMBL::Hive::AnalysisStats->collection()->add( $foreign_stats ); # add it to the collection
+            } elsif( UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::NakedTable') ) {
+            } elsif( UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Accumulator') ) {
+            } else {
+                warn "Do not know how to handle the type '".ref($target_object)."'";
+            }
         }
 
         if( my $funnel_dataflow_rule  = $df_rule->funnel_dataflow_rule ) {
@@ -282,7 +290,9 @@ sub _propagate_allocation {
     my ($self, $source_analysis ) = @_;
 
     foreach my $df_rule ( @{ $source_analysis->dataflow_rules_collection } ) {    # this will only work if the analyses objects are ALL cached before loading DFRs
-        my $target_object       = $df_rule->to_analysis();
+        my $target_object       = $df_rule->to_analysis
+            or die "Could not fetch a target object for url='".$df_rule->to_analysis_url."', please check your database for consistency.\n";
+
         my $target_node_name;
 
         if(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Analysis')) {
@@ -292,7 +302,7 @@ sub _propagate_allocation {
         } elsif(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Accumulator')) {
             next;
         } else {
-            warn('Do not know how to handle the type '.ref($target_object));
+            warn("Do not know how to handle the type '".ref($target_object)."'");
             next;
         }
 
@@ -454,8 +464,12 @@ sub _add_dataflow_rules {
 
     foreach my $df_rule ( @$dataflow_rules ) {
     
-        my ($from_analysis, $branch_code, $funnel_dataflow_rule, $target_object) =
-            ($df_rule->from_analysis, $df_rule->branch_code, $df_rule->funnel_dataflow_rule, $df_rule->to_analysis);
+        my ($from_analysis, $branch_code, $funnel_dataflow_rule) =
+            ($df_rule->from_analysis, $df_rule->branch_code, $df_rule->funnel_dataflow_rule);
+
+        my $target_object       = $df_rule->to_analysis
+            or die "Could not fetch a target object for url='".$df_rule->to_analysis_url."', please check your database for consistency.\n";
+
         my $from_node_name = $self->_analysis_node_name( $from_analysis );
         my $target_node_name;
     
@@ -474,7 +488,7 @@ sub _add_dataflow_rules {
             $target_node_name = _midpoint_name( $from_analysis->{'_funnel_dfr'} );
 
         } else {
-            warn('Do not know how to handle the type '.ref($target_object));
+            warn("Do not know how to handle the type '".ref($target_object)."'");
             next;
         }