diff --git a/R/PSO_v2012.R b/R/PSO_v2012.R
index 975e406dde9990af12636513c88df27c56c4d908..0948dfca38fe2d29ce19f69e43e5499f911c3bbb 100755
--- a/R/PSO_v2012.R
+++ b/R/PSO_v2012.R
@@ -2002,6 +2002,7 @@ hydroPSO <- function(
 
     if (topology != "random") {
       nc <- K  
+      #nc <- npart
       if (trunc(K/2) != ceiling(K/2)) {
         N   <- (K-1)/2
       } else N  <- K/2
@@ -2915,8 +2916,11 @@ hydroPSO <- function(
       write.table(format(tmp, scientific=TRUE, digits=digits), file=fname, col.names=TRUE, row.names=FALSE, sep="  ", quote=FALSE)
 
       # Writing the file 'X.neighbours.txt' 
-      fname <- paste(file.path(drty.out), "/", "Particles_Neighbours.txt", sep="") 	
-      write.table(X.neighbours, file=fname, col.names=paste("Neigh", 1:npart, sep=""), row.names=paste("Part", 1:npart, sep=""), sep="  ", na="", quote=FALSE) 
+      fname <- paste(file.path(drty.out), "/", "Particles_Neighbours.txt", sep="") 
+      print(X.neighbours)	
+      print(paste("Neigh", 1:npart, sep=""))
+      ifelse(topology == "lbest", nc <- K, nc <- npart)
+      write.table(X.neighbours, file=fname, col.names=paste("Neigh", 1:nc, sep=""), row.names=paste("Part", 1:npart, sep=""), sep="  ", na="", quote=FALSE) 
 
       # Writing the file 'LocalBest.txt' 
       fname <- paste(file.path(drty.out), "/", "LocalBest.txt", sep="") 	
diff --git a/R/plot_2parOF.R b/R/plot_2parOF.R
index 31f58875127cc0efd4a5c3637c8cdb636c86b4c4..fd20afa683c21ae5b411144a8617ac84b657f19e 100755
--- a/R/plot_2parOF.R
+++ b/R/plot_2parOF.R
@@ -89,6 +89,11 @@ plot_2parOF <- function(params,
     ifelse(MinMax=="max", decreasing<-FALSE, decreasing<-TRUE)
     p <- p[order(p[, gof.name], decreasing = decreasing), ]
     
+    # Define a transformation
+    norm_trans <- function(){
+      trans_new('norm', function(x) pnorm(x), function(x) qnorm(x))
+    }
+  
     if (type=="sp") {
       colnames(p) <- c("x", "y", gof.name)