diff --git a/pt_matrix_mesh.cc b/pt_matrix_mesh.cc
index deda1e48a32645e2a79d24924ea7be221b45b8ca..2220375cfb137c538f729aa50720eb52a596b1c2 100644
--- a/pt_matrix_mesh.cc
+++ b/pt_matrix_mesh.cc
@@ -310,6 +310,7 @@ void mesh_lengths(){
   }
   ////////////////////////////////////
   float xst,yst,zst,x,y,z;
+  int ftype;
   int nparticles=opts.nparticles.value();
   int nsteps=opts.nsteps.value();
   ///////////////////////////////////
@@ -345,11 +346,10 @@ void mesh_lengths(){
   path=1;
 
   float tmp2;
-  float randtmp1,randtmp2,randtmp3;
   ColumnVector th_ph_f;
   
   Mesh mseeds;
-  int ftype=mseeds.load(opts.meshfile.value()); 
+  ftype=mseeds.load(opts.meshfile.value());
   mseeds.load_fs_label(opts.seedfile.value());
   ColumnVector mni_origin(3),fs_coord_mm(3),xyz_dti,xyz_seeds,dim_seeds(3);
   dim_seeds<<prob.xdim()<<prob.ydim()<<prob.zdim(); //In seedref space if exists. Else in dti space