diff --git a/src/gui/workerthread.cpp b/src/gui/workerthread.cpp
index 904e2c5e65a80714f39b69448362611df61a1321..5a6fc5fa916704ab930ec921f3bdd4b1b5c93e86 100644
--- a/src/gui/workerthread.cpp
+++ b/src/gui/workerthread.cpp
@@ -57,103 +57,177 @@ WorkerThread::WorkerThread(MainWindow *p_main_window)
 #if QT_VERSION >= 0x050000
   // Qt5 code
   // worker message
-  connect(_p_work_monitor, &WorkMonitor::workerMessage, p_main_window,
+  connect(_p_work_monitor,
+          &WorkMonitor::workerMessage,
+          p_main_window,
           &MainWindow::doDisplayLoadingMessage);
-  connect(_p_work_monitor, &WorkMonitor::workerMessagePercent, p_main_window,
+  connect(_p_work_monitor,
+          &WorkMonitor::workerMessagePercent,
+          p_main_window,
           &MainWindow::doDisplayLoadingMessagePercent);
-  connect(_p_work_monitor, &WorkMonitor::workerAppendText, p_main_window,
+  connect(_p_work_monitor,
+          &WorkMonitor::workerAppendText,
+          p_main_window,
           &MainWindow::doWorkerAppendText);
-  connect(_p_work_monitor, &WorkMonitor::workerSetText, p_main_window,
+  connect(_p_work_monitor,
+          &WorkMonitor::workerSetText,
+          p_main_window,
           &MainWindow::doWorkerSetText);
-  connect(_p_work_monitor, &WorkMonitor::workerJobFinished, p_main_window,
+  connect(_p_work_monitor,
+          &WorkMonitor::workerJobFinished,
+          p_main_window,
           &MainWindow::doDisplayJobFinished);
 
-  connect(p_main_window, &MainWindow::operateXpipFile, this,
+  connect(p_main_window,
+          &MainWindow::operateXpipFile,
+          this,
           &WorkerThread::doXpipFileLoad);
-  connect(p_main_window, &MainWindow::operateWritingXpipFile, this,
+  connect(p_main_window,
+          &MainWindow::operateWritingXpipFile,
+          this,
           &WorkerThread::doWritingXpipFile);
-  connect(this, &WorkerThread::projectReady, p_main_window,
+  connect(this,
+          &WorkerThread::projectReady,
+          p_main_window,
           &MainWindow::doProjectReady);
-  connect(this, &WorkerThread::loadingResultsFinished, p_main_window,
+  connect(this,
+          &WorkerThread::loadingResultsFinished,
+          p_main_window,
           &MainWindow::doLoadingResultsReady);
 
-  connect(p_main_window, &MainWindow::operateLoadingResults, this,
+  connect(p_main_window,
+          &MainWindow::operateLoadingResults,
+          this,
           &WorkerThread::doLoadingResults);
 
-  connect(p_main_window, &MainWindow::operateRunningXtandem, this,
+  connect(p_main_window,
+          &MainWindow::operateRunningXtandem,
+          this,
           &WorkerThread::doRunningXtandem);
-  connect(this, &WorkerThread::loadingMessage, p_main_window,
+  connect(this,
+          &WorkerThread::loadingMessage,
+          p_main_window,
           &MainWindow::doDisplayLoadingMessage);
-  connect(this, &WorkerThread::projectNotReady, p_main_window,
+  connect(this,
+          &WorkerThread::projectNotReady,
+          p_main_window,
           &MainWindow::doProjectNotReady);
 
   // grouping
-  connect(p_main_window, &MainWindow::operateGrouping, this,
+  connect(p_main_window,
+          &MainWindow::operateGrouping,
+          this,
           &WorkerThread::doGrouping);
-  connect(this, &WorkerThread::groupingFinished, p_main_window,
+  connect(this,
+          &WorkerThread::groupingFinished,
+          p_main_window,
           &MainWindow::doGroupingFinished);
   // masschroq write
-  connect(p_main_window, &MainWindow::operateWritingMassChroqFile, this,
+  connect(p_main_window,
+          &MainWindow::operateWritingMassChroqFile,
+          this,
           &WorkerThread::doWritingMassChroqFile);
-  connect(p_main_window, &MainWindow::operateWritingMassChroqPrmFile, this,
+  connect(p_main_window,
+          &MainWindow::operateWritingMassChroqPrmFile,
+          this,
           &WorkerThread::doWritingMassChroqPrmFile);
-  connect(p_main_window, &MainWindow::operateWritingMcqrSpectralCountFile, this,
+  connect(p_main_window,
+          &MainWindow::operateWritingMcqrSpectralCountFile,
+          this,
           &WorkerThread::doWritingMcqrSpectralCountFile);
   // protic write
-  connect(p_main_window, &MainWindow::operateWritingProticFile, this,
+  connect(p_main_window,
+          &MainWindow::operateWritingProticFile,
+          this,
           &WorkerThread::doWritingProticFile);
   // writing ODS file :
-  connect(p_main_window, &MainWindow::operateWritingOdsFile, this,
+  connect(p_main_window,
+          &MainWindow::operateWritingOdsFile,
+          this,
           &WorkerThread::doWritingOdsFile);
-  connect(this, &WorkerThread::operationFailed, p_main_window,
+  connect(this,
+          &WorkerThread::operationFailed,
+          p_main_window,
           &MainWindow::doOperationFailed);
-  connect(this, &WorkerThread::operationFinished, p_main_window,
+  connect(this,
+          &WorkerThread::operationFinished,
+          p_main_window,
           &MainWindow::doOperationFinished);
 
 #else
   // Qt4 code
   // worker message
-  connect(_p_work_monitor, SIGNAL(workerMessage(QString)), p_main_window,
+  connect(_p_work_monitor,
+          SIGNAL(workerMessage(QString)),
+          p_main_window,
           SLOT(doDisplayLoadingMessage(QString)));
-  connect(_p_work_monitor, SIGNAL(workerMessage(QString, int)), p_main_window,
+  connect(_p_work_monitor,
+          SIGNAL(workerMessage(QString, int)),
+          p_main_window,
           SLOT(doDisplayLoadingMessage(QString, int)));
-  connect(_p_work_monitor, SIGNAL(workerAppendText(char *)), p_main_window,
+  connect(_p_work_monitor,
+          SIGNAL(workerAppendText(char *)),
+          p_main_window,
           SLOT(doWorkerAppendText(char *)));
 
-  connect(p_main_window, SIGNAL(operateXpipFile(QString)), this,
+  connect(p_main_window,
+          SIGNAL(operateXpipFile(QString)),
+          this,
           SLOT(doXpipFileLoad(QString)));
-  connect(this, SIGNAL(projectReady(ProjectSp)), p_main_window,
+  connect(this,
+          SIGNAL(projectReady(ProjectSp)),
+          p_main_window,
           SLOT(doProjectReady(ProjectSp)));
   connect(
     p_main_window,
     SIGNAL(operateLoadingResults(bool, AutomaticFilterParameters, QStringList)),
-    this, SLOT(doLoadingResults(bool, AutomaticFilterParameters, QStringList)));
+    this,
+    SLOT(doLoadingResults(bool, AutomaticFilterParameters, QStringList)));
 
-  connect(p_main_window, SIGNAL(operateRunningXtandem(TandemRunBatch)), this,
+  connect(p_main_window,
+          SIGNAL(operateRunningXtandem(TandemRunBatch)),
+          this,
           SLOT(doRunningXtandem(TandemRunBatch)));
-  connect(this, SIGNAL(loadingMessage(QString)), p_main_window,
+  connect(this,
+          SIGNAL(loadingMessage(QString)),
+          p_main_window,
           SLOT(doDisplayLoadingMessage(QString)));
-  connect(this, SIGNAL(projectNotReady(QString)), p_main_window,
+  connect(this,
+          SIGNAL(projectNotReady(QString)),
+          p_main_window,
           SLOT(doProjectNotReady(QString)));
 
   // grouping
-  connect(p_main_window, SIGNAL(operateGrouping(ProjectSp)), this,
+  connect(p_main_window,
+          SIGNAL(operateGrouping(ProjectSp)),
+          this,
           SLOT(doGrouping(ProjectSp)));
-  connect(this, SIGNAL(groupingFinished()), p_main_window,
+  connect(this,
+          SIGNAL(groupingFinished()),
+          p_main_window,
           SLOT(doGroupingFinished()));
   // masschroq write
   connect(p_main_window,
-          SIGNAL(operateWritingMassChroqFile(QString, ProjectSp)), this,
+          SIGNAL(operateWritingMassChroqFile(QString, ProjectSp)),
+          this,
           SLOT(doWritingMassChroqFile(QString, ProjectSp)));
   // protic write
-  connect(p_main_window, SIGNAL(operateWritingProticFile(QString, ProjectSp)),
-          this, SLOT(doWritingProticFile(QString, ProjectSp)));
+  connect(p_main_window,
+          SIGNAL(operateWritingProticFile(QString, ProjectSp)),
+          this,
+          SLOT(doWritingProticFile(QString, ProjectSp)));
   // writing ODS file :
-  connect(p_main_window, SIGNAL(operateWritingOdsFile(QString, ProjectSp)),
-          this, SLOT(doWritingOdsFile(QString, ProjectSp)));
-  connect(this, SIGNAL(operationFailed(QString)), p_main_window,
+  connect(p_main_window,
+          SIGNAL(operateWritingOdsFile(QString, ProjectSp)),
+          this,
+          SLOT(doWritingOdsFile(QString, ProjectSp)));
+  connect(this,
+          SIGNAL(operationFailed(QString)),
+          p_main_window,
           SLOT(doOperationFailed(QString)));
-  connect(this, SIGNAL(operationFinished()), p_main_window,
+  connect(this,
+          SIGNAL(operationFinished()),
+          p_main_window,
           SLOT(doOperationFinished()));
 #endif
 
@@ -162,7 +236,7 @@ WorkerThread::WorkerThread(MainWindow *p_main_window)
 
 WorkerThread::WorkerThread(ProjectWindow *p_project_window)
 {
-  qDebug() << "WorkerThread::WorkerThread begin ProjectWindow";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 
   _p_work_monitor = new WorkMonitor();
 
@@ -170,62 +244,96 @@ WorkerThread::WorkerThread(ProjectWindow *p_project_window)
   // Qt5 code
 
   // worker message
-  connect(_p_work_monitor, &WorkMonitor::workerMessage, p_project_window,
+  connect(_p_work_monitor,
+          &WorkMonitor::workerMessage,
+          p_project_window,
           &ProjectWindow::doDisplayLoadingMessage);
-  connect(_p_work_monitor, &WorkMonitor::workerMessagePercent, p_project_window,
+  connect(_p_work_monitor,
+          &WorkMonitor::workerMessagePercent,
+          p_project_window,
           &ProjectWindow::doDisplayLoadingMessagePercent);
-  connect(this, &WorkerThread::loadingMessage, p_project_window,
+  connect(this,
+          &WorkerThread::loadingMessage,
+          p_project_window,
           &ProjectWindow::doDisplayLoadingMessage);
   // grouping
-  connect(p_project_window, &ProjectWindow::operateGrouping, this,
+  connect(p_project_window,
+          &ProjectWindow::operateGrouping,
+          this,
           &WorkerThread::doGrouping);
-  connect(this, &WorkerThread::groupingFinished, p_project_window,
+  connect(this,
+          &WorkerThread::groupingFinished,
+          p_project_window,
           &ProjectWindow::doGroupingFinished);
 
 
   // PTM grouping on IdentificationGroup
-  connect(p_project_window, &ProjectWindow::operatePtmGroupingOnIdentification,
-          this, &WorkerThread::doPtmGroupingOnIdentification);
-  connect(this, &WorkerThread::ptmGroupingOnIdentificationFinished,
-          p_project_window, &ProjectWindow::refreshPtmGroup);
+  connect(p_project_window,
+          &ProjectWindow::operatePtmGroupingOnIdentification,
+          this,
+          &WorkerThread::doPtmGroupingOnIdentification);
+  connect(this,
+          &WorkerThread::ptmGroupingOnIdentificationFinished,
+          p_project_window,
+          &ProjectWindow::refreshPtmGroup);
 
   // grouping on IdentificationGroup
-  connect(p_project_window, &ProjectWindow::operateGroupingOnIdentification,
-          this, &WorkerThread::doGroupingOnIdentification);
-  connect(this, &WorkerThread::groupingOnIdentificationFinished,
-          p_project_window, &ProjectWindow::refreshGroup);
+  connect(p_project_window,
+          &ProjectWindow::operateGroupingOnIdentification,
+          this,
+          &WorkerThread::doGroupingOnIdentification);
+  connect(this,
+          &WorkerThread::groupingOnIdentificationFinished,
+          p_project_window,
+          &ProjectWindow::refreshGroup);
 
-  connect(this, &WorkerThread::operationFailed, p_project_window,
+  connect(this,
+          &WorkerThread::operationFailed,
+          p_project_window,
           &ProjectWindow::doOperationFailed);
-  connect(this, &WorkerThread::operationFinished, p_project_window,
+  connect(this,
+          &WorkerThread::operationFinished,
+          p_project_window,
           &ProjectWindow::doOperationFinished);
 
 #else
   // Qt4 code
-  qDebug() << "WorkerThread::WorkerThread Qt4 code";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 
   // worker message
-  connect(_p_work_monitor, SIGNAL(workerMessage(QString)), p_project_window,
+  connect(_p_work_monitor,
+          SIGNAL(workerMessage(QString)),
+          p_project_window,
           SLOT(doDisplayLoadingMessage(QString)));
-  connect(_p_work_monitor, SIGNAL(workerMessage(QString, int)),
-          p_project_window, SLOT(doDisplayLoadingMessage(QString, int)));
+  connect(_p_work_monitor,
+          SIGNAL(workerMessage(QString, int)),
+          p_project_window,
+          SLOT(doDisplayLoadingMessage(QString, int)));
 
-  connect(this, SIGNAL(loadingMessage(QString)), p_project_window,
+  connect(this,
+          SIGNAL(loadingMessage(QString)),
+          p_project_window,
           SLOT(doDisplayLoadingMessage(QString)));
   // grouping
-  connect(p_project_window, SIGNAL(operateGrouping(ProjectSp)), this,
+  connect(p_project_window,
+          SIGNAL(operateGrouping(ProjectSp)),
+          this,
           SLOT(doGrouping(ProjectSp)));
-  connect(this, SIGNAL(groupingFinished()), p_project_window,
+  connect(this,
+          SIGNAL(groupingFinished()),
+          p_project_window,
           SLOT(doGroupingFinished()));
 
 
   // PTM grouping on IdentificationGroup
   connect(p_project_window,
           SIGNAL(operatePtmGroupingOnIdentification(IdentificationGroup *)),
-          this, SLOT(doPtmGroupingOnIdentification(IdentificationGroup *)));
+          this,
+          SLOT(doPtmGroupingOnIdentification(IdentificationGroup *)));
   connect(this,
           SIGNAL(ptmGroupingOnIdentificationFinished(IdentificationGroup *)),
-          p_project_window, SLOT(refreshPtmGroup(IdentificationGroup *)));
+          p_project_window,
+          SLOT(refreshPtmGroup(IdentificationGroup *)));
 
   // grouping on IdentificationGroup
   connect(
@@ -234,21 +342,27 @@ WorkerThread::WorkerThread(ProjectWindow *p_project_window)
       operateGroupingOnIdentification(IdentificationGroup *, GroupingType)),
     this,
     SLOT(doGroupingOnIdentification(IdentificationGroup *, GroupingType)));
-  connect(this, SIGNAL(groupingOnIdentificationFinished(IdentificationGroup *)),
-          p_project_window, SLOT(refreshGroup(IdentificationGroup *)));
+  connect(this,
+          SIGNAL(groupingOnIdentificationFinished(IdentificationGroup *)),
+          p_project_window,
+          SLOT(refreshGroup(IdentificationGroup *)));
 
-  connect(this, SIGNAL(operationFailed(QString)), p_project_window,
+  connect(this,
+          SIGNAL(operationFailed(QString)),
+          p_project_window,
           SLOT(doOperationFailed(QString)));
-  connect(this, SIGNAL(operationFinished()), p_project_window,
+  connect(this,
+          SIGNAL(operationFinished()),
+          p_project_window,
           SLOT(doOperationFinished()));
 
 #endif
-  qDebug() << "WorkerThread::WorkerThread end ProjectWindow";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 }
 
 WorkerThread::~WorkerThread()
 {
-  qDebug() << "WorkerThread::WorkerThread destructor";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 }
 
 void
@@ -279,7 +393,7 @@ void
 WorkerThread::doPtmGroupingOnIdentification(
   IdentificationGroup *p_identification_group)
 {
-  qDebug() << "WorkerThread::doPtmGroupingOnIdentification begin ";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
   try
     {
       emit loadingMessage(tr("computing PTM islands"));
@@ -305,14 +419,14 @@ WorkerThread::doPtmGroupingOnIdentification(
       emit operationFailed(
         tr("Error while computing PTM islands :\n%1").arg(error.qwhat()));
     }
-  qDebug() << "WorkerThread::doPtmGroupingOnIdentification end ";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 }
 
 void
 WorkerThread::doGroupingOnIdentification(
   IdentificationGroup *p_identification_group, GroupingType grouping_type)
 {
-  qDebug() << "WorkerThread::doGroupingOnIdentification begin ";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
   try
     {
       emit loadingMessage(tr("grouping proteins"));
@@ -337,12 +451,12 @@ WorkerThread::doGroupingOnIdentification(
     {
       emit operationFailed(tr("Error while grouping :\n%1").arg(error.qwhat()));
     }
-  qDebug() << "WorkerThread::doGroupingOnIdentification end ";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 }
 void
 WorkerThread::doGrouping(ProjectSp project_sp)
 {
-  qDebug() << "WorkerThread::doGrouping begin ";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
   try
     {
       emit loadingMessage(tr("grouping proteins"));
@@ -367,7 +481,7 @@ WorkerThread::doGrouping(ProjectSp project_sp)
     {
       emit operationFailed(tr("Error while grouping :\n%1").arg(error.qwhat()));
     }
-  qDebug() << "WorkerThread::doGrouping end ";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 }
 
 void
@@ -519,7 +633,7 @@ WorkerThread::doLoadingResults(bool is_individual,
                                QStringList file_list)
 {
 
-  qDebug() << "WorkerThread::doLoadingResults begin ";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
   try
     {
       if(file_list.size() == 0)
@@ -551,22 +665,22 @@ WorkerThread::doLoadingResults(bool is_individual,
 
       emit loadingMessage(tr("filtering proteins"));
       project_sp.get()->updateAutomaticFilters(param);
-      qDebug() << "WorkerThread::doLoadingResults emit "
-                  "loadingResultsFinished(project_sp) ";
+      qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
       emit loadingResultsFinished(project_sp);
     }
   catch(pappso::PappsoException &error)
     {
-      qDebug() << "WorkerThread::doLoadingResults error ";
+      qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
+               << error.qwhat();
       emit projectNotReady(
         tr("Error while reading result files :\n%1").arg(error.qwhat()));
     }
-  qDebug() << "WorkerThread::doLoadingResults end ";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 }
 void
 WorkerThread::doRunningXtandem(TandemRunBatch tandem_run_batch)
 {
-  qDebug() << "WorkerThread::doRunningXtandem begin ";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
   try
     {
       emit loadingMessage(tr("Running X!Tandem, please wait"));
@@ -579,14 +693,14 @@ WorkerThread::doRunningXtandem(TandemRunBatch tandem_run_batch)
 
       if(use_htcondor)
         {
-          TandemCondorProcess xt_process(_p_main_window, _p_work_monitor,
-                                         tandem_run_batch);
+          TandemCondorProcess xt_process(
+            _p_main_window, _p_work_monitor, tandem_run_batch);
           xt_process.run();
         }
       else
         {
-          TandemBatchProcess xt_process(_p_main_window, _p_work_monitor,
-                                        tandem_run_batch);
+          TandemBatchProcess xt_process(
+            _p_main_window, _p_work_monitor, tandem_run_batch);
           xt_process.run();
         }
 
@@ -594,8 +708,10 @@ WorkerThread::doRunningXtandem(TandemRunBatch tandem_run_batch)
     }
   catch(pappso::PappsoException &error)
     {
+      qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
+               << error.qwhat();
       emit operationFailed(
         tr("Error while running X!Tandem job :\n%1").arg(error.qwhat()));
     }
-  qDebug() << "WorkerThread::doRunningXtandem end ";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 }
diff --git a/src/input/mascot/mascotdatparser.cpp b/src/input/mascot/mascotdatparser.cpp
index 1fde28eaf9217af05778419f962f0147087358e5..681ce94486b1b0e4621bb73aba4b45f2d6f1b61b 100644
--- a/src/input/mascot/mascotdatparser.cpp
+++ b/src/input/mascot/mascotdatparser.cpp
@@ -38,7 +38,8 @@
 #include "../../core/peptideevidence.h"
 
 MascotDatParser::MascotDatParser(
-  Project *p_project, IdentificationGroup *p_identification_group,
+  Project *p_project,
+  IdentificationGroup *p_identification_group,
   IdentificationDataSource *p_identification_data_source)
 {
   _p_project                    = p_project;
@@ -415,8 +416,9 @@ MascotDatParser::parsePeptidesLine(const QString &peptide_line)
 
   catch(pappso::PappsoException exception_pappso)
     {
-      _error_str = QObject::tr("ERROR in MascotDatParser::parsePeptidesLine "
-                               "%1, PAPPSO exception:\n%2")
+      _error_str = QObject::tr(
+                     "ERROR in MascotDatParser::parsePeptidesLine "
+                     "%1, PAPPSO exception:\n%2")
                      .arg(peptide_line)
                      .arg(exception_pappso.qwhat());
       qDebug() << _error_str;
@@ -633,9 +635,10 @@ MascotDatParser::savePeptideList(std::vector<PeptideLine> &peptide_list,
 
       if(is_decoy)
         {
-          peptide_evidence.setEvalue(getEvalue(
-            ion_score, _decoy_summary_list.at(_current_query.query_index - 1),
-            0.05));
+          peptide_evidence.setEvalue(
+            getEvalue(ion_score,
+                      _decoy_summary_list.at(_current_query.query_index - 1),
+                      0.05));
         }
       else
         {
@@ -767,7 +770,8 @@ MascotDatParser::getEvalue(pappso::pappso_double ion_score,
 
 pappso::pappso_double
 MascotDatParser::getEvalueExperimental(
-  pappso::pappso_double ion_score, SummaryLine &summary_line,
+  pappso::pappso_double ion_score,
+  SummaryLine &summary_line,
   pappso::pappso_double confidence_interval) const
 {
   // Evalue experimental  Homology threshold (QPlughole value from .dat file).
@@ -780,16 +784,41 @@ void
 MascotDatParser::setVariableModifications(PeptideXtpSp &peptide_sp,
                                           QString variable_modifications_string)
 {
-  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
+           << variable_modifications_string;
   //
   for(unsigned int i = 0; i < variable_modifications_string.size(); i++)
     {
+      qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
+               << variable_modifications_string.mid(i, 1).toUInt();
       if(variable_modifications_string.mid(i, 1).toUInt() > 0)
         {
           MascotModification mascot_modification = _delta_modification_list
             [variable_modifications_string.mid(i, 1).toUInt() - 1];
-          peptide_sp.get()->addAaModification(mascot_modification.modification,
-                                              i - 1);
+          try
+            {
+              if(i == 0)
+                {
+                  peptide_sp.get()->addAaModification(
+                    mascot_modification.modification, 0);
+                }
+              else
+                {
+                  peptide_sp.get()->addAaModification(
+                    mascot_modification.modification, i - 1);
+                }
+            }
+          catch(pappso::PappsoException &error)
+            {
+              throw pappso::PappsoException(
+                QObject::tr("ERROR adding modification %1 to peptide %2 at "
+                            "position %3 :\n %4")
+                  .arg(mascot_modification.modification->getAccession())
+                  .arg(peptide_sp.get()->toAbsoluteString())
+                  .arg(i - 1)
+                  .arg(error.qwhat()));
+            }
         }
     }
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 }
diff --git a/src/input/mascot/mascotdatparser.h b/src/input/mascot/mascotdatparser.h
index bd170cc00018859dab0e19e6621ec318c195ecd3..8003831506bb5fde72cebc9240d3e72a97c3c744 100644
--- a/src/input/mascot/mascotdatparser.h
+++ b/src/input/mascot/mascotdatparser.h
@@ -80,13 +80,14 @@ class MascotDatParser
   };
   struct SummaryLine
   {
-    pappso::pappso_double match = 0; // qmatch, identity threshold
-    pappso::pappso_double exp_mass = 0;
+    pappso::pappso_double match     = 0; // qmatch, identity threshold
+    pappso::pappso_double exp_mass  = 0;
     pappso::pappso_double plug_hole = 0; // qplughole, homology threshold
   };
   void savePeptideList(std::vector<PeptideLine> &peptide_list, bool is_decoy);
   pappso::pappso_double
-  getEvalue(pappso::pappso_double ion_score, SummaryLine &summary_line,
+  getEvalue(pappso::pappso_double ion_score,
+            SummaryLine &summary_line,
             pappso::pappso_double confidence_interval = 0.05) const;
   pappso::pappso_double
   getEvalueExperimental(pappso::pappso_double ion_score,
diff --git a/src/input/mascot/mimeparser.cpp b/src/input/mascot/mimeparser.cpp
index 9afe6a3e3f869e02d905c83efdf20bb67e76abc3..74ac11f03f7f610ec9b8b9d4309c658a249ece86 100644
--- a/src/input/mascot/mimeparser.cpp
+++ b/src/input/mascot/mimeparser.cpp
@@ -40,12 +40,14 @@ MimeParser::MimeParser(QIODevice *p_inputstream)
 
 MimeParser::~MimeParser()
 {
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
   close();
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 }
 bool
 MimeParser::open()
 {
-  qDebug() << "MimeParser::open begin";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
   if(_p_inputstream->open(QIODevice::ReadOnly))
     {
       _real_in = new QTextStream(_p_inputstream);
@@ -55,12 +57,12 @@ MimeParser::open()
       throw pappso::PappsoException(
         QObject::tr("Error opening mime QIODevice"));
     }
-  qDebug() << "MimeParser::open end";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 }
 bool
 MimeParser::close()
 {
-  qDebug() << "MimeParser::close begin";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 
   _priv_file_string = "";
   if(_p_current_file_content != nullptr)
@@ -68,21 +70,21 @@ MimeParser::close()
       delete _p_current_file_content;
       _p_current_file_content = nullptr;
     }
-  qDebug() << "MimeParser::close delete _real_in";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
   if(_real_in != nullptr)
     {
       delete _real_in;
       _real_in = nullptr;
     }
 
-  qDebug() << "MimeParser::close delete _p_inputstream";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
   if(_p_inputstream != nullptr)
     {
       _p_inputstream->close();
       // delete _p_inputstream;
       _p_inputstream = nullptr;
     }
-  qDebug() << "MimeParser::close end";
+  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
 }
 bool
 MimeParser::goToFirstFile()