diff --git a/NAMESPACE b/NAMESPACE
index eefcaa144c0c2d78cefbc6a026bf21ea2f79bf71..bf0d5781aa6f8abab21bdd6f6ac49c23c16bab0f 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -16,4 +16,5 @@ export(Zbeta_expected)
 export(Zbeta_log_rsq_over_expected)
 export(Zbeta_rsq_over_expected)
 importFrom(stats,cor)
+importFrom(stats,na.omit)
 importFrom(stats,pbeta)
diff --git a/R/Zalpha_BetaCDF.R b/R/Zalpha_BetaCDF.R
index 69cf1b71c38a74411779b1ff63ffbb0343fefc8d..69442fa8fc220403c9af36eb3c2b5fc359d292d5 100644
--- a/R/Zalpha_BetaCDF.R
+++ b/R/Zalpha_BetaCDF.R
@@ -16,7 +16,7 @@
 #' profile should consist of evenly sized bins of distances (for example 0.0001 cM per bin), where the value given is the (inclusive) lower
 #' bound of the bin.
 #'
-#' @importFrom stats cor pbeta
+#' @importFrom stats cor pbeta na.omit
 #'
 #' @param pos A numeric vector of SNP locations
 #' @param ws The window size which the \eqn{Z_{\alpha}^{BetaCDF}}{Zalpha} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.
@@ -60,7 +60,7 @@ Zalpha_BetaCDF<-function(pos, ws, x, dist, LDprofile_bins, LDprofile_Beta_a, LDp
     stop("The number of rows in x must equal the number of SNP locations given in pos")
   }
   #Check SNPs are all biallelic
-  if(sum(apply(x,1,function(x){length(unique(x))}) != 2)>0){
+  if(sum(apply(x,1,function(x){length(na.omit(unique(x)))}) != 2)>0){
     stop("SNPs must all be biallelic")
   }
   #Check dist is a numeric vector
diff --git a/R/Zalpha_Zscore.R b/R/Zalpha_Zscore.R
index f044925c2e636e5298bb58e470038bb21999b276..0f57e56b0c95352d704f777b554c71f03e6034f2 100644
--- a/R/Zalpha_Zscore.R
+++ b/R/Zalpha_Zscore.R
@@ -15,7 +15,7 @@
 #' profile should consist of evenly sized bins of distances (for example 0.0001 cM per bin), where the value given is the (inclusive) lower
 #' bound of the bin.
 #'
-#' @importFrom stats cor
+#' @importFrom stats cor na.omit
 #'
 #' @param pos A numeric vector of SNP locations
 #' @param ws The window size which the \eqn{Z_{\alpha}^{Zscore}}{Zalpha} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.
@@ -59,7 +59,7 @@ Zalpha_Zscore<-function(pos, ws, x, dist, LDprofile_bins, LDprofile_rsq, LDprofi
     stop("The number of rows in x must equal the number of SNP locations given in pos")
   }
   #Check SNPs are all biallelic
-  if(sum(apply(x,1,function(x){length(unique(x))}) != 2)>0){
+  if(sum(apply(x,1,function(x){length(na.omit(unique(x)))}) != 2)>0){
     stop("SNPs must all be biallelic")
   }
   #Check dist is a numeric vector
diff --git a/R/Zalpha_all.R b/R/Zalpha_all.R
index 30d81a8dd13924737385b44acbe3cf3037d5f055..b6a40be1e9efb252de5d88b5aea07c21840b039e 100644
--- a/R/Zalpha_all.R
+++ b/R/Zalpha_all.R
@@ -13,7 +13,7 @@
 #' }
 #' For more information about the statistics, please see Jacobs (2016).
 #'
-#' @importFrom stats cor pbeta
+#' @importFrom stats cor pbeta na.omit
 #'
 #' @param pos A numeric vector of SNP locations
 #' @param ws The window size which the statistics will be calculated over. This should be on the same scale as the \code{pos} vector.
@@ -65,7 +65,7 @@ Zalpha_all <- function(pos, ws, x=NULL, dist=NULL, LDprofile_bins=NULL, LDprofil
       stop("The number of rows in x must equal the number of SNP locations given in pos")
     }
     #Check SNPs are all biallelic
-    if(sum(apply(x,1,function(x){length(unique(x))}) != 2)>0){
+    if(sum(apply(x,1,function(x){length(na.omit(unique(x)))}) != 2)>0){
       stop("SNPs must all be biallelic")
     }
     #Change matrix x to numeric if it isn't already
diff --git a/R/Zalpha_log_rsq_over_expected.R b/R/Zalpha_log_rsq_over_expected.R
index 09e2a6b56b80c64b0549246fb6315a93ac30c572..18a1141f5fbf25ff4cb201a9cef6f42d1c66f05a 100644
--- a/R/Zalpha_log_rsq_over_expected.R
+++ b/R/Zalpha_log_rsq_over_expected.R
@@ -15,7 +15,7 @@
 #' profile should consist of evenly sized bins of distances (for example 0.0001 cM per bin), where the value given is the (inclusive) lower
 #' bound of the bin.
 #'
-#' @importFrom stats cor
+#' @importFrom stats cor na.omit
 #'
 #' @param pos A numeric vector of SNP locations
 #' @param ws The window size which the \eqn{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}{Zalpha} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.
@@ -58,7 +58,7 @@ Zalpha_log_rsq_over_expected<-function(pos, ws, x, dist, LDprofile_bins, LDprofi
     stop("The number of rows in x must equal the number of SNP locations given in pos")
   }
   #Check SNPs are all biallelic
-  if(sum(apply(x,1,function(x){length(unique(x))}) != 2)>0){
+  if(sum(apply(x,1,function(x){length(na.omit(unique(x)))}) != 2)>0){
     stop("SNPs must all be biallelic")
   }
   #Check dist is a numeric vector
diff --git a/R/Zalpha_rsq_over_expected.R b/R/Zalpha_rsq_over_expected.R
index bffcbc78ceb5f7ebec636e0e2cd92270d6a90a5b..7e8ef5d15664a6581b6cd38d0172247b21986374 100644
--- a/R/Zalpha_rsq_over_expected.R
+++ b/R/Zalpha_rsq_over_expected.R
@@ -15,7 +15,7 @@
 #' profile should consist of evenly sized bins of distances (for example 0.0001 cM per bin), where the value given is the (inclusive) lower
 #' bound of the bin.
 #'
-#' @importFrom stats cor
+#' @importFrom stats cor na.omit
 #'
 #' @param pos A numeric vector of SNP locations
 #' @param ws The window size which the \eqn{Z_{\alpha}^{r^2/E[r^2]}}{Zalpha} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.
@@ -58,7 +58,7 @@ Zalpha_rsq_over_expected<-function(pos, ws, x, dist, LDprofile_bins, LDprofile_r
     stop("The number of rows in x must equal the number of SNP locations given in pos")
   }
   #Check SNPs are all biallelic
-  if(sum(apply(x,1,function(x){length(unique(x))}) != 2)>0){
+  if(sum(apply(x,1,function(x){length(na.omit(unique(x)))}) != 2)>0){
     stop("SNPs must all be biallelic")
   }
   #Check dist is a numeric vector
diff --git a/R/Zbeta.R b/R/Zbeta.R
index 3ed2dfe75836e1d070b38d84299d7c8f98f4a012..8b9a5f0e5165ab225578dcd4d0653a1f8fdfd329 100644
--- a/R/Zbeta.R
+++ b/R/Zbeta.R
@@ -7,7 +7,7 @@
 #' \deqn{Z_{\beta}=\frac{\sum_{i \in L,j \in R}r^2_{i,j}}{|L||R|}}
 #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, and \eqn{r^2}{r^2} is equal to the squared correlation between a pair of SNPs
 #'
-#' @importFrom stats cor
+#' @importFrom stats cor na.omit
 #'
 #' @param pos A numeric vector of SNP locations
 #' @param ws The window size which the \eqn{Z_{\beta}}{Zbeta} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.
@@ -44,7 +44,7 @@ Zbeta <- function(pos, ws, x, minRandL = 4, minRL = 25, X = NULL) {
     stop("The number of rows in x must equal the number of SNP locations given in pos")
   }
   #Check SNPs are all biallelic
-  if(sum(apply(x,1,function(x){length(unique(x))}) != 2)>0){
+  if(sum(apply(x,1,function(x){length(na.omit(unique(x)))}) != 2)>0){
     stop("SNPs must all be biallelic")
   }
   #Check windowsize is a number greater than 0
diff --git a/R/Zbeta_BetaCDF.R b/R/Zbeta_BetaCDF.R
index a67ae22b010f90c50f5ec7195e1fef7ed094137d..1908284c47a172c02adfe7298d7233f3e6e5331e 100644
--- a/R/Zbeta_BetaCDF.R
+++ b/R/Zbeta_BetaCDF.R
@@ -16,7 +16,7 @@
 #' profile should consist of evenly sized bins of distances (for example 0.0001 cM per bin), where the value given is the (inclusive) lower
 #' bound of the bin.
 #'
-#' @importFrom stats cor pbeta
+#' @importFrom stats cor pbeta na.omit
 #'
 #' @param pos A numeric vector of SNP locations
 #' @param ws The window size which the \eqn{Z_{\beta}^{BetaCDF}}{Zbeta} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.
@@ -60,7 +60,7 @@ Zbeta_BetaCDF<-function(pos, ws, x, dist, LDprofile_bins, LDprofile_Beta_a, LDpr
     stop("The number of rows in x must equal the number of SNP locations given in pos")
   }
   #Check SNPs are all biallelic
-  if(sum(apply(x,1,function(x){length(unique(x))}) != 2)>0){
+  if(sum(apply(x,1,function(x){length(na.omit(unique(x)))}) != 2)>0){
     stop("SNPs must all be biallelic")
   }
   #Check dist is a numeric vector
diff --git a/R/Zbeta_Zscore.R b/R/Zbeta_Zscore.R
index 29ba79e267756af7b8bb76993286871820b12ae8..76eda7dbbd17bf64b87ee25c9bde51fcb0370adc 100644
--- a/R/Zbeta_Zscore.R
+++ b/R/Zbeta_Zscore.R
@@ -15,7 +15,7 @@
 #' profile should consist of evenly sized bins of distances (for example 0.0001 cM per bin), where the value given is the (inclusive) lower
 #' bound of the bin.
 #'
-#' @importFrom stats cor
+#' @importFrom stats cor na.omit
 #'
 #' @param pos A numeric vector of SNP locations
 #' @param ws The window size which the \eqn{Z_{\beta}^{Zscore}}{Zbeta} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.
@@ -59,7 +59,7 @@ Zbeta_Zscore<-function(pos, ws, x, dist, LDprofile_bins, LDprofile_rsq, LDprofil
     stop("The number of rows in x must equal the number of SNP locations given in pos")
   }
   #Check SNPs are all biallelic
-  if(sum(apply(x,1,function(x){length(unique(x))}) != 2)>0){
+  if(sum(apply(x,1,function(x){length(na.omit(unique(x)))}) != 2)>0){
     stop("SNPs must all be biallelic")
   }
   #Check dist is a numeric vector
diff --git a/R/Zbeta_log_rsq_over_expected.R b/R/Zbeta_log_rsq_over_expected.R
index e257c6752fac5e88318f5f957d7fad12ca08535a..7e8bbecc14f7474e1789a9227a0febb8a638817c 100644
--- a/R/Zbeta_log_rsq_over_expected.R
+++ b/R/Zbeta_log_rsq_over_expected.R
@@ -15,7 +15,7 @@
 #' profile should consist of evenly sized bins of distances (for example 0.0001 cM per bin), where the value given is the (inclusive) lower
 #' bound of the bin.
 #'
-#' @importFrom stats cor
+#' @importFrom stats cor na.omit
 #'
 #' @param pos A numeric vector of SNP locations
 #' @param ws The window size which the \eqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}}{Zbeta} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.
@@ -58,7 +58,7 @@ Zbeta_log_rsq_over_expected<-function(pos, ws, x, dist, LDprofile_bins, LDprofil
     stop("The number of rows in x must equal the number of SNP locations given in pos")
   }
   #Check SNPs are all biallelic
-  if(sum(apply(x,1,function(x){length(unique(x))}) != 2)>0){
+  if(sum(apply(x,1,function(x){length(na.omit(unique(x)))}) != 2)>0){
     stop("SNPs must all be biallelic")
   }
   #Check dist is a numeric vector
diff --git a/R/Zbeta_rsq_over_expected.R b/R/Zbeta_rsq_over_expected.R
index 30bb6a05519861ffcc73e22dfea6f319df6444d2..af0262d10d995dd330f822d5c085acb3c60f8543 100644
--- a/R/Zbeta_rsq_over_expected.R
+++ b/R/Zbeta_rsq_over_expected.R
@@ -15,7 +15,7 @@
 #' profile should consist of evenly sized bins of distances (for example 0.0001 cM per bin), where the value given is the (inclusive) lower
 #' bound of the bin.
 #'
-#' @importFrom stats cor
+#' @importFrom stats cor na.omit
 #'
 #' @param pos A numeric vector of SNP locations
 #' @param ws The window size which the \eqn{Z_{\beta}^{r^2/E[r^2]}}{Zbeta} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.
@@ -58,7 +58,7 @@ Zbeta_rsq_over_expected<-function(pos, ws, x, dist, LDprofile_bins, LDprofile_rs
     stop("The number of rows in x must equal the number of SNP locations given in pos")
   }
   #Check SNPs are all biallelic
-  if(sum(apply(x,1,function(x){length(unique(x))}) != 2)>0){
+  if(sum(apply(x,1,function(x){length(na.omit(unique(x)))}) != 2)>0){
     stop("SNPs must all be biallelic")
   }
   #Check dist is a numeric vector
diff --git a/R/zalpha.R b/R/zalpha.R
index c7cc51d710da145a80e28d861cc823247f25e738..c9c1fdeeef6df916ada20d90b367b3599177a280 100644
--- a/R/zalpha.R
+++ b/R/zalpha.R
@@ -7,7 +7,7 @@
 #' \deqn{Z_{\alpha}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}r^2_{i,j} + {|R| \choose 2}^{-1}\sum_{i,j \in L}r^2_{i,j}}{2}}
 #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, and \eqn{r^2}{r^2} is equal to the squared correlation between a pair of SNPs
 #'
-#' @importFrom stats cor
+#' @importFrom stats cor na.omit
 #'
 #' @param pos A numeric vector of SNP locations
 #' @param ws The window size which the \eqn{Z_{\alpha}}{Zalpha} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.
@@ -44,7 +44,7 @@ Zalpha <- function(pos, ws, x, minRandL = 4, minRL = 25, X = NULL) {
     stop("The number of rows in x must equal the number of SNP locations given in pos")
   }
   #Check SNPs are all biallelic
-  if(sum(apply(x,1,function(x){length(unique(x))}) != 2)>0){
+  if(sum(apply(x,1,function(x){length(na.omit(unique(x)))}) != 2)>0){
     stop("SNPs must all be biallelic")
   }
   #Check windowsize is a number greater than 0