diff --git a/application/models/Oqrs_model.php b/application/models/Oqrs_model.php
index bff1e895f..07a4bce2f 100644
--- a/application/models/Oqrs_model.php
+++ b/application/models/Oqrs_model.php
@@ -603,7 +603,7 @@ class Oqrs_model extends CI_Model {
$this->db->from('oqrs');
$this->db->join('station_profile', 'station_profile.station_id = oqrs.station_id');
$this->db->where('oqrs.id', $oqrsid);
- $this->db->where('oqrs.qsoid', 0); // Ensure we are adding a match to an empty qsoid
+ $this->db->where('oqrs.qsoid IS NULL', null, false); // Ensure we are adding a match to an empty qsoid
$this->db->where('station_profile.user_id', $this->session->userdata('user_id'));
$query = $this->db->get();
diff --git a/application/views/oqrs/qsolist.php b/application/views/oqrs/qsolist.php
index 7465b4226..9f8cf981f 100644
--- a/application/views/oqrs/qsolist.php
+++ b/application/views/oqrs/qsolist.php
@@ -206,7 +206,7 @@ function return_add_print_button($qso_id, $qslsent) {
}
function return_add_match_qso_button($qso_id, $qsoid, $matchqsoid, $oqrsid) {
- if ($qso_id != $qsoid && $matchqsoid == 0) return '';
+ if ($qso_id != $qsoid && $matchqsoid == null) return '';
return '';
}