diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md
index d495176306b354e974ea55b6bd100b631f28544a..ea234eb27558694bf3fcff47432d3eb3844d9a52 100644
--- a/PULL_REQUEST_TEMPLATE.md
+++ b/PULL_REQUEST_TEMPLATE.md
@@ -1,4 +1,4 @@
-### Requirements
+## Requirements
 
 - Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion;
 - Review the [contributing guidelines](https://github.com/Ensembl/ensembl/blob/release/90/CONTRIBUTING.md#why-could-my-pull-request-be-rejected) for this repository; remember in particular:
@@ -7,13 +7,13 @@
     - if you change the schema you must patch the test databases as well, see [Updating the schema](https://github.com/Ensembl/ensembl/blob/release/90/CONTRIBUTING.md#updating-the-schema)
     - the PR must not fail unit testing
 
-### Description
+## Description
 
 _One or more sentences describing in detail the proposed changes._
 
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut feugiat ligula vel enim congue, nec faucibus turpis ornare. Integer nulla massa, fermentum nec elit a, dapibus luctus ante. Vestibulum eleifend enim et consectetur convallis.
 
-### Use case
+## Use case
 
 _Describe the problem. Please provide an example representing the motivation behind the need for having these changes in place._
 
@@ -21,19 +21,19 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lobortis aliqu
 
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam ultrices egestas urna, vel mollis felis viverra iaculis. Phasellus ac nisi imperdiet ipsum viverra porta.
 
-### Benefits
+## Benefits
 
 _If applicable, describe the advantages the changes will have._
 
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget diam quis leo faucibus sagittis. Sed dapibus, magna ut porttitor malesuada, lorem purus tincidunt magna, ut dignissim mi quam et elit.
 
-### Possible Drawbacks
+## Possible Drawbacks
 
 _If applicable, describe any possible undesirable consequence of the changes._
 
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras molestie tincidunt quam, id dapibus mauris consequat eu. Phasellus in neque quis purus laoreet malesuada in sit amet tellus.
 
-### Testing
+## Testing
 
 _Have you added/modified unit tests to test the changes?_
 
diff --git a/misc-scripts/db/db-space.pl b/misc-scripts/db/db-space.pl
old mode 100644
new mode 100755
index db72ff71ea9fc307f56cf7025a51ad60b451ac70..e72d7d1c985af2147c4ec9e586566a42cbf0a2e9
--- a/misc-scripts/db/db-space.pl
+++ b/misc-scripts/db/db-space.pl
@@ -43,8 +43,6 @@ push(@options, "port=s", \$port);
 
 die "Couldn't parse options" if !GetOptions(@options);
 
-die "Must give -password\n" if !defined($pw);
-
 my $cmd = mysql_cmd("show databases");
 open(CMD, $cmd) or die "Couldn't $cmd: $!\n";
 my @databases;
@@ -157,6 +155,7 @@ foreach my $size (sort {$b<=>$a} keys %top_tables) {
 sub mysql_cmd {
   my $mysql_cmd = shift;
 
-  return "mysql -uroot -h$host -u$user -p$pw -P$port -e '$mysql_cmd'|";
+  my $pw_args = $pw ? "-p$pw" : '';
+  return "mysql -uroot -h$host -u$user $pw_args -P$port -e '$mysql_cmd'|";
 }
 
diff --git a/misc-scripts/xref_mapping/XrefMapper/ProcessPaired.pm b/misc-scripts/xref_mapping/XrefMapper/ProcessPaired.pm
index c254c87391c5121547fb91ea78e4024c6a755b66..ddeed0f930470e0665ef9416b2f1de2c18ef7f62 100644
--- a/misc-scripts/xref_mapping/XrefMapper/ProcessPaired.pm
+++ b/misc-scripts/xref_mapping/XrefMapper/ProcessPaired.pm
@@ -106,16 +106,6 @@ sub process{
 
 	  if (!$transl_object_xref_id) {
 
-	      #check if an object xref exists with status other than 'DUMP_OUT'
-	      $ox_translation_other_status_sth->execute($translation_id, $pep_source_id, $pep_accession);
-	      ($transl_object_xref_id, $xref_id) = $ox_translation_other_status_sth->fetchrow_array();
-
-	      if ($transl_object_xref_id) {
-		  #update the object xref
-		  $ox_update_sth->execute($transl_object_xref_id)|| die "Could not update object_xref $transl_object_xref_id";
-		  $xref_update_sth->execute($xref_id)|| die "Could not update xref $xref_id";
-		  $change{'translation object_xrefs updated'}++;
-	      } else {
 		  #add a new object xref 
 		  $xref_sth->execute($pep_accession, $pep_source_id);
 		  ($xref_id) = $xref_sth->fetchrow_array();
@@ -132,7 +122,6 @@ sub process{
 		  $change{'translation object xrefs added'}++;
 		  $object_xref_id++;
 		  $transl_object_xref_id = $object_xref_id;
-	      }
 	      
 	  }
 
diff --git a/misc-scripts/xref_mapping/XrefMapper/ProcessPrioritys.pm b/misc-scripts/xref_mapping/XrefMapper/ProcessPrioritys.pm
index 85fc3d7ad695910d39c24d9533f5698beb7a5007..c5b662c89dca250ccfa05f2f116d9d2d417c069a 100644
--- a/misc-scripts/xref_mapping/XrefMapper/ProcessPrioritys.pm
+++ b/misc-scripts/xref_mapping/XrefMapper/ProcessPrioritys.pm
@@ -126,7 +126,6 @@ FSQL
         WHERE ox.object_xref_id = ix.object_xref_id 
           AND ox.xref_id = x.xref_id
           AND s.source_id = x.source_id
-          AND ox_status != 'FAILED_CUTOFF'
           AND s.name = ?
          ORDER BY x.accession DESC, s.priority ASC , identity DESC, x.xref_id DESC
 NEWS
@@ -208,6 +207,10 @@ SEQCP
             $update_x_sth->execute($xref_id);
           }
         } else {
+# Alignment did not pass, dismiss
+          if ($status eq 'FAILED_CUTOFF') {
+            next;
+          }
           ## There might be several mappings for the best priority
           push @best_ensembl_id, $ensembl_id;
         }
@@ -269,7 +272,7 @@ sub process_dependents{
   my @master_xrefs = ($old_master_xref_id);
   my $recursive = 0;
 
-  my ($new_object_type, $new_ensembl_id);
+  my ($new_object_type, $new_ensembl_id, $old_object_type, $old_ensembl_id);
   my ($dep_xref_id, $linkage_annotation, $new_object_xref_id, $linkage_source_id, $object_type);
 
 
@@ -280,6 +283,12 @@ sub process_dependents{
   while ($matching_ens_sth->fetch()) {
     push @{ $ensembl_ids{$new_object_type} }, $new_ensembl_id;
   }
+  my %old_ensembl_ids;
+  $matching_ens_sth->execute($old_master_xref_id);
+  $matching_ens_sth->bind_columns(\$old_object_type, \$old_ensembl_id);
+  while ($matching_ens_sth->fetch()) {
+    push @{ $old_ensembl_ids{$old_object_type} }, $old_ensembl_id;
+  }
 
 
   ## Loop through all dependent xrefs of old master xref, and recurse
@@ -296,7 +305,9 @@ sub process_dependents{
 
       # Remove all mappings to low priority xrefs
       # Then delete any leftover identity or go xrefs of it
-      $self->_detach_object_xref($xref_id, $dep_xref_id, $object_type);
+      foreach my $ensembl_id (@{ $old_ensembl_ids{$object_type}} ) {
+        $self->_detach_object_xref($xref_id, $dep_xref_id, $object_type, $ensembl_id);
+      }
 
       # Duplicate each dependent for the new master xref if it is the first in the chain
       unless ($recursive) {
@@ -338,31 +349,31 @@ sub process_dependents{
 # Set unimportant object_xrefs to FAILED_PRIORITY, and delete all those that remain
 sub _detach_object_xref {
   my $self = shift;
-  my ($xref_id, $dep_xref_id, $object_type) = @_;
+  my ($xref_id, $dep_xref_id, $object_type, $ensembl_id) = @_;
   # Drop all the identity and go xrefs for the dependents of an xref
   my $remove_dep_ox_sth = $self->xref->dbc->prepare(
     "DELETE ix, g FROM object_xref ox \
      LEFT JOIN identity_xref ix ON ix.object_xref_id = ox.object_xref_id \
      LEFT JOIN go_xref g ON g.object_xref_id = ox.object_xref_id \
-     WHERE master_xref_id = ? AND ensembl_object_type = ? AND xref_id = ?"
+     WHERE master_xref_id = ? AND ensembl_object_type = ? AND xref_id = ? AND ensembl_id = ?"
   );
   # Fail the object_xrefs that did link to the deleted identity/go xrefs.
   # This only updates one of potentially many, due to table contraints.
   my $update_dep_ox_sth = $self->xref->dbc->prepare(
     "UPDATE IGNORE object_xref SET ox_status = 'FAILED_PRIORITY' \
-    WHERE master_xref_id = ? AND ensembl_object_type = ? AND xref_id = ? AND ox_status = 'DUMP_OUT'"
+    WHERE master_xref_id = ? AND ensembl_object_type = ? AND xref_id = ? AND ox_status = 'DUMP_OUT' AND ensembl_id = ?"
   );
   # This deletes everything left behind by the previous query.
   my $clean_dep_ox_sth  = $self->xref->dbc->prepare(
     "DELETE FROM object_xref \
-    WHERE master_xref_id = ? AND ensembl_object_type = ? AND xref_id = ? AND ox_status = 'DUMP_OUT'"
+    WHERE master_xref_id = ? AND ensembl_object_type = ? AND xref_id = ? AND ox_status = 'DUMP_OUT' AND ensembl_id = ?"
   );
 
-  $remove_dep_ox_sth->execute($xref_id, $object_type, $dep_xref_id);
+  $remove_dep_ox_sth->execute($xref_id, $object_type, $dep_xref_id, $ensembl_id);
   # change status of object_xref to FAILED_PRIORITY for record keeping
-  $update_dep_ox_sth->execute($xref_id, $object_type, $dep_xref_id);
+  $update_dep_ox_sth->execute($xref_id, $object_type, $dep_xref_id, $ensembl_id);
   # delete the duplicates.
-  $clean_dep_ox_sth->execute($xref_id, $object_type, $dep_xref_id);
+  $clean_dep_ox_sth->execute($xref_id, $object_type, $dep_xref_id, $ensembl_id);
 
   $remove_dep_ox_sth->finish();
   $update_dep_ox_sth->finish();
diff --git a/misc-scripts/xref_mapping/XrefParser/RefSeqGPFFParser.pm b/misc-scripts/xref_mapping/XrefParser/RefSeqGPFFParser.pm
index b550cfbc442b7087821db97d601d69dc0c946749..37da140c579c3bbe5cc547882466acfc5b1af2d1 100644
--- a/misc-scripts/xref_mapping/XrefParser/RefSeqGPFFParser.pm
+++ b/misc-scripts/xref_mapping/XrefParser/RefSeqGPFFParser.pm
@@ -202,6 +202,7 @@ sub create_xrefs {
     {
       my ($acc) = $entry =~ /ACCESSION\s+(\S+)/;
       my ($ver) = $entry =~ /VERSION\s+(\S+)/;
+      my ($refseq_pair) = $entry =~ /DBSOURCE\s+REFSEQ: accession (\S+)/;
 
       # get the right source ID based on $type and whether this is predicted (X*) or not
       my $source_id;
@@ -272,6 +273,9 @@ sub create_xrefs {
       foreach my $cb (@coded_by){
 	$xref->{PAIR} = $cb;
       }
+      if (!defined $xref->{PAIR}) {
+        $xref->{PAIR} = $refseq_pair;
+      }
 
       foreach my $pi (@protein_id){
 	$xref->{PROTEIN} = $pi;