--- src/ScanBMA_full.cpp
+++ src/ScanBMA_full.cpp
@@ -134,7 +134,7 @@
   // Create a vector of indices sorted by the prior
   // then use that to get the correct indices
   // (decreasing)
-  arma::uvec pord = sort_index(priorProbs, 1);
+  arma::uvec pord = sort_index(priorProbs, "d");
 
   // Compute log(prior/(1-prior))
   NumericVector logprior(H);
@@ -325,7 +325,7 @@
 // Create a vector of indices sorted by the prior
 // then use that to get the correct indices
 // (decreasing)
-arma::uvec pord = sort_index(priorProbs, 1);
+arma::uvec pord = sort_index(priorProbs, "d");
 // Compute log(prior/(1-prior))
 NumericVector logprior(H);
 for ( int i = 0; i < H; i++ ) {
@@ -418,7 +418,7 @@
   // Create a vector of indices sorted by the prior
   // then use that to get the correct indices
   // (decreasing)
-  arma::uvec pord = sort_index(priorProbs, 1);
+  arma::uvec pord = sort_index(priorProbs, "d");
 
   // Compute log(prior/(1-prior))
   NumericVector logprior(H);
@@ -611,7 +611,7 @@
 // Create a vector of indices sorted by the prior
 // then use that to get the correct indices
 // (decreasing)
-arma::uvec pord = sort_index(priorProbs, 1);
+arma::uvec pord = sort_index(priorProbs, "d");
 // Compute log(prior/(1-prior))
 NumericVector logprior(H);
 for ( int i = 0; i < H; i++ ) {
