Index: branches/cname-collision/DNSDB.pm
===================================================================
--- branches/cname-collision/DNSDB.pm	(revision 940)
+++ branches/cname-collision/DNSDB.pm	(revision 941)
@@ -635,5 +635,5 @@
 #  my $msg = 'OK';
 
-  if ($args{type} == 5) {
+  if (${$args{rectype}} == 5) {
     # First, check for non-CNAME collisions.
     my @t = $dbh->selectrow_array("SELECT count(*) FROM "._rectable($args{defrec}, $args{revrec}).
@@ -876,8 +876,8 @@
       return ('FAIL', $errstr) if ! _check_hostname_form(${$args{val}}, ${$args{rectype}}, $args{defrec}, $args{revrec});
 
-      return ('FAIL', $errstr) unless $self->_cname_collision(%args);
-
     } # $zname !~ .rpz
   } # revzone eq 'n'
+
+  return ('FAIL', $errstr) unless $self->_cname_collision(%args);
 
   return ('OK','OK');
