diff --git a/src/ShortestPath/Transit/TransitAlgorithmState.h b/src/ShortestPath/Transit/TransitAlgorithmState.h
index f0cfded693f0a72ad79cd40965d5232c1d54cce5..48707ee68e84fdfdc5d3e0da3759c1bfdac142af 100644
--- a/src/ShortestPath/Transit/TransitAlgorithmState.h
+++ b/src/ShortestPath/Transit/TransitAlgorithmState.h
@@ -116,8 +116,8 @@ public:
      */
     [[nodiscard]] bool strictlyDominates(const TransitAlgorithmState& rhs) const {
         return this->_nodeIndex == rhs.getNodeIndex() //same current node
-               && ((this->getInstant() < rhs.getInstant() && (this->getConnections().size() <= rhs.getConnections().size() || rhs.getConnections().empty()))
-               || (this->getInstant() < rhs.getInstant() && this->getConnections().size() == rhs.getConnections().size()));
+               && ((!this->getConnections().empty() && rhs.getConnections().empty())
+               || (this->getInstant() <= rhs.getInstant() && this->getConnections().size() <= rhs.getConnections().size()));
     }
 
     /**
diff --git a/src/ShortestPath/Transit/TransitStateContainer.h b/src/ShortestPath/Transit/TransitStateContainer.h
index b962c0b71b6fcbb82abb332d607b58871e9c16ce..2b8a88d145b866a2ad344e659c86e63328b08a28 100644
--- a/src/ShortestPath/Transit/TransitStateContainer.h
+++ b/src/ShortestPath/Transit/TransitStateContainer.h
@@ -8,6 +8,13 @@
 #include <vector>
 #include "TransitShortestPath.h"
 
+#ifdef DEBUG_TRANSIT_PRECOMPUTE
+#include <iostream>
+#define DEBUG_MSG(str) do { std::cout << str << std::endl; } while( false )
+#else
+#define DEBUG_MSG(str) do { } while ( false )
+#endif
+
 class TransitStateContainer {
 private:
     //    int x,delta;
@@ -32,13 +39,19 @@ public:
 
     bool tryAddNewState(int nodeIndex, const TransitAlgorithmState& newState)
     {
-        if(newState.strictlyDominates(solutionVector.at(nodeIndex)[0])) {
+        DEBUG_MSG("Trying to add state " + newState.toString());
+        if(!solutionVector.at(nodeIndex).empty() && newState.strictlyDominates(solutionVector.at(nodeIndex)[0])) {
+            DEBUG_MSG("Added state to position 0, replacing " + solutionVector.at(nodeIndex)[0].toString());
             solutionVector.at(nodeIndex)[0] = newState;
             return true;
-        } else if(newState.strictlyDominates(solutionVector.at(nodeIndex)[1])) {
+        } else if(solutionVector.at(nodeIndex).size() > 1 && newState.strictlyDominates(solutionVector.at(nodeIndex)[1])) {
+            DEBUG_MSG("Added state to position 1, replacing " + solutionVector.at(nodeIndex)[1].toString());
             solutionVector.at(nodeIndex)[1] = newState;
             return true;
         } else {
+            DEBUG_MSG("State wasn't added to the container because it doesn't dominate \n" +
+                        solutionVector.at(nodeIndex)[0].toString() +
+                        (solutionVector.at(nodeIndex).size() > 1 ? "\nor " + solutionVector.at(nodeIndex)[1].toString() : ""));
             return false;
         }
     }