diff --git a/bfps/_base.py b/bfps/_base.py
index f0225337b533b6ae02ce47b3f670312deab9a9dc..4b48ee73b646b0f684b7ecf1bfd627000322a737 100644
--- a/bfps/_base.py
+++ b/bfps/_base.py
@@ -56,7 +56,7 @@ class _base(object):
         key = sorted(list(parameters.keys()))
         src_txt = ''
         for i in range(len(key)):
-            if (type(parameters[key[i]]) == int  && parameters[key[i]] >= 1<<30) || type(parameters[key[i]]) == long:
+            if (type(parameters[key[i]]) == int  and parameters[key[i]] >= 1<<30):
                 src_txt += 'long long int ' + key[i] + ';\n'
             elif type(parameters[key[i]]) == int:
                 src_txt += 'int ' + key[i] + ';\n'
@@ -101,7 +101,7 @@ class _base(object):
         for i in range(len(key)):
             src_txt += 'dset = H5Dopen(parameter_file, "/{0}/{1}", H5P_DEFAULT);\n'.format(
                     file_group, key[i])
-            if (type(parameters[key[i]]) == int  && parameters[key[i]] >= 1<<30) || type(parameters[key[i]]) == long:
+            if (type(parameters[key[i]]) == int and parameters[key[i]] >= 1<<30):
                 src_txt += 'H5Dread(dset, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, &{0});\n'.format(key[i])
             elif type(parameters[key[i]]) == int:
                 src_txt += 'H5Dread(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &{0});\n'.format(key[i])
diff --git a/bfps/cpp/full_code/NSVEp.cpp b/bfps/cpp/full_code/NSVEp.cpp
index 9de13469470c61e7c4115c79a032ec8a66ade3fa..8ce8478c635161690fc0dd2313e7e4b09267a16c 100644
--- a/bfps/cpp/full_code/NSVEp.cpp
+++ b/bfps/cpp/full_code/NSVEp.cpp
@@ -63,7 +63,7 @@ int NSVEp<rnumber>::initialize(void)
                 fs->cvelocity,              // (field object)
                 fs->kk,                     // (kspace object, contains dkx, dky, dkz)
                 tracers0_integration_steps, // to check coherency between parameters and hdf input file (nb rhs)
-                nparticles,                 // to check coherency between parameters and hdf input file
+                (long long int)nparticles,  // to check coherency between parameters and hdf input file
                 fs->get_current_fname(),    // particles input filename
                 std::string("/tracers0/state/") + std::to_string(fs->iteration), // dataset name for initial input
                 std::string("/tracers0/rhs/")  + std::to_string(fs->iteration), // dataset name for initial input
@@ -71,7 +71,7 @@ int NSVEp<rnumber>::initialize(void)
                 tracers0_smoothness,        // parameter
                 this->comm,
                 fs->iteration+1);
-    this->particles_output_writer_mpi = new particles_output_hdf5<double,3,3>(
+    this->particles_output_writer_mpi = new particles_output_hdf5<long long int,double,3,3>(
                 MPI_COMM_WORLD,
                 "tracers0",
                 nparticles,
diff --git a/bfps/cpp/full_code/NSVEp.hpp b/bfps/cpp/full_code/NSVEp.hpp
index 31f61f6d7f83a898f9ef0e3a4b6a4c32b2e66d98..2b3d97ef505a59f857ce49b1ac16323007105ec3 100644
--- a/bfps/cpp/full_code/NSVEp.hpp
+++ b/bfps/cpp/full_code/NSVEp.hpp
@@ -63,8 +63,8 @@ class NSVEp: public direct_numerical_simulation
         vorticity_equation<rnumber, FFTW> *fs;
         field<rnumber, FFTW, THREE> *tmp_vec_field;
         field<rnumber, FFTW, ONE> *tmp_scal_field;
-        std::unique_ptr<abstract_particles_system<double>> ps;
-        particles_output_hdf5<double,3,3> *particles_output_writer_mpi;
+        std::unique_ptr<abstract_particles_system<long long int, double>> ps;
+        particles_output_hdf5<long long int, double,3,3> *particles_output_writer_mpi;
 
 
         NSVEp(