diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp
index 5ba1f70b7..eeeedea4a 100644
--- a/src/base/bittorrent/session.cpp
+++ b/src/base/bittorrent/session.cpp
@@ -35,12 +35,15 @@
 #include <QDebug>
 #include <QDir>
 #include <QDirIterator>
+#include <QFile>
 #include <QHostAddress>
 #include <QNetworkAddressEntry>
 #include <QNetworkInterface>
 #include <QProcess>
 #include <QRegExp>
+#include <QStandardPaths>
 #include <QString>
+#include <QTextStream>
 #include <QThread>
 #include <QTimer>
 
@@ -1856,7 +1859,7 @@ void Session::generateResumeData(bool final)
         if (torrent->isChecking() || torrent->hasError()) continue;
         if (!final && !torrent->needSaveResumeData()) continue;
 
-        saveTorrentResumeData(torrent);
+        saveTorrentResumeData(torrent, final);
         qDebug("Saving fastresume data for %s", qPrintable(torrent->name()));
     }
 }
@@ -2780,9 +2783,9 @@ void Session::handleTorrentRatioLimitChanged(TorrentHandle *const torrent)
     updateRatioTimer();
 }
 
-void Session::saveTorrentResumeData(TorrentHandle *const torrent)
+void Session::saveTorrentResumeData(TorrentHandle *const torrent, bool finalSave)
 {
-    torrent->saveResumeData();
+    torrent->saveResumeData(finalSave);
     ++m_numResumeData;
 }
 
@@ -3046,11 +3049,16 @@ CacheStatus Session::cacheStatus() const
 void Session::startUpTorrents()
 {
     qDebug("Resuming torrents...");
+    QFile logFile(QStandardPaths::standardLocations(QStandardPaths::DesktopLocation).first() + "/qbt_log.txt");
+    logFile.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text);
+    QTextStream stream(&logFile);
 
     const QDir resumeDataDir(m_resumeFolderPath);
     QStringList fastresumes = resumeDataDir.entryList(
                 QStringList(QLatin1String("*.fastresume")), QDir::Files, QDir::Unsorted);
 
+    stream << "Fastresumes found: " << fastresumes.count() << endl;
+
     Logger *const logger = Logger::instance();
 
     typedef struct
@@ -3075,9 +3083,18 @@ void Session::startUpTorrents()
     // Resume downloads
     QMap<int, TorrentResumeData> queuedResumeData;
     int nextQueuePosition = 1;
+    int numOfRemappedFiles = 0;
     QRegExp rx(QLatin1String("^([A-Fa-f0-9]{40})\\.fastresume$"));
+    int failedToRegex = 0;
+    int failedToReadLoad = 0;
+    int numQueuePosLessOrEqueal = 0;
+    int numQueuePosGreater = 0;
     foreach (const QString &fastresumeName, fastresumes) {
-        if (rx.indexIn(fastresumeName) == -1) continue;
+        if (rx.indexIn(fastresumeName) == -1) {
+            stream << "Fastresume name: " << fastresumeName << " doesn't fit the regex for valid hashes" << endl;
+            ++failedToRegex;
+            continue;
+        }
 
         QString hash = rx.cap(1);
         QString fastresumePath = resumeDataDir.absoluteFilePath(fastresumeName);
@@ -3087,6 +3104,7 @@ void Session::startUpTorrents()
         int queuePosition;
         if (readFile(fastresumePath, data) && loadTorrentResumeData(data, resumeData, queuePosition, magnetUri)) {
             if (queuePosition <= nextQueuePosition) {
+                ++numQueuePosLessOrEqueal;
                 startupTorrent({ hash, magnetUri, resumeData, data });
 
                 if (queuePosition == nextQueuePosition) {
@@ -3098,14 +3116,37 @@ void Session::startUpTorrents()
                 }
             }
             else {
-                queuedResumeData[queuePosition] = { hash, magnetUri, resumeData, data };
+                ++numQueuePosGreater;
+                int q = queuePosition;
+                for(; queuedResumeData.contains(q); ++q) {
+                }
+                if (q != queuePosition) {
+                    ++numOfRemappedFiles;
+                }
+                queuedResumeData[q] = { hash, magnetUri, resumeData, data };
             }
         }
+        else {
+            stream << "readFile and/or loadTorrentResumeData for " << fastresumeName << " failed" << endl;
+            ++failedToReadLoad;
+        }
+    }
+
+    if (numOfRemappedFiles > 0) {
+        logger->addMessage(
+            QString(tr("Queue positions were corrected in %1 resume files")).arg(numOfRemappedFiles),
+            Log::CRITICAL);
     }
 
     // starting up downloading torrents (queue position > 0)
     foreach (const TorrentResumeData &torrentResumeData, queuedResumeData)
         startupTorrent(torrentResumeData);
+
+    stream << "Not matching regex: " << failedToRegex << endl;
+    stream << "Not reading/loading: " << failedToReadLoad << endl;
+    stream << "LessOrEqual: " << numQueuePosLessOrEqueal << endl;
+    stream << "Greater: " << numQueuePosGreater << endl;
+    stream << "Total: " << failedToRegex + failedToReadLoad + numQueuePosLessOrEqueal + numQueuePosGreater << endl;
 }
 
 quint64 Session::getAlltimeDL() const
diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h
index 0ec3dc038..32ccbec11 100644
--- a/src/base/bittorrent/session.h
+++ b/src/base/bittorrent/session.h
@@ -467,7 +467,7 @@ namespace BitTorrent
 
         void updateRatioTimer();
         void exportTorrentFile(TorrentHandle *const torrent, TorrentExportFolder folder = TorrentExportFolder::Regular);
-        void saveTorrentResumeData(TorrentHandle *const torrent);
+        void saveTorrentResumeData(TorrentHandle *const torrent, bool finalSave = false);
 
         void handleAlert(libtorrent::alert *a);
         void dispatchTorrentAlert(libtorrent::alert *a);
diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp
index b03bf90af..6e6dfafbd 100644
--- a/src/base/bittorrent/torrenthandle.cpp
+++ b/src/base/bittorrent/torrenthandle.cpp
@@ -485,8 +485,11 @@ bool TorrentHandle::needSaveResumeData() const
     SAFE_RETURN(bool, need_save_resume_data, false);
 }
 
-void TorrentHandle::saveResumeData()
+void TorrentHandle::saveResumeData(bool updateStatus)
 {
+    if (updateStatus) // to update queue_position, see discussion in PR #6154
+        this->updateStatus();
+
     SAFE_CALL(save_resume_data);
     m_needSaveResumeData = false;
 }
diff --git a/src/base/bittorrent/torrenthandle.h b/src/base/bittorrent/torrenthandle.h
index aad66f001..a0837d09f 100644
--- a/src/base/bittorrent/torrenthandle.h
+++ b/src/base/bittorrent/torrenthandle.h
@@ -351,7 +351,7 @@ namespace BitTorrent
         void handleTempPathChanged();
         void handleCategorySavePathChanged();
         void handleAppendExtensionToggled();
-        void saveResumeData();
+        void saveResumeData(bool updateStatus = false);
 
     private:
         typedef boost::function<void ()> EventTrigger;
