diff --git a/layout.sty b/layout.sty
index a64eeacae83f11344d27930f3642ee02e6538a43..456145d7b52049e610e6d2571f733e381ecaf6fd 100644
--- a/layout.sty
+++ b/layout.sty
@@ -1034,12 +1034,6 @@ bookmarks=true]%
   \stepcounter{r2}%
   \stepcounter{r3}%
   \stepcounter{r4}%
-  \stepcounter{r2t3}%
-  \stepcounter{r3t4}%
-  \stepcounter{r4t5}%
-  \stepcounter{r4t6}%
-  \stepcounter{r0t1}%
-  \stepcounter{rn1t0}
   \setcounter{rn4tn1}{\value{r4b}}%
   \addtocounter{rn4tn1}{-5}%
   \setcounter{rn3t3}{\value{r3b}}%
@@ -1051,11 +1045,20 @@ bookmarks=true]%
     \stepcounter{r2b}%
     \stepcounter{r3b}%
     \stepcounter{r2t4}
+    \stepcounter{r4t5}%
   \else%
     \multiply\value{rn3t3} by -1%
     \addtocounter{rn3t3}{0}%
-    \stepcounter{rn1t2}
+    \stepcounter{r3c}%
+    \stepcounter{r4t6}%
+    \stepcounter{r0t1}%
+    \stepcounter{rn1t0}
+  \fi%
+  \ifodd\value{r3b}%
     \stepcounter{r2c}%
+    \stepcounter{r3t4}%
+  \else%
+    \stepcounter{r2t3}%
     \stepcounter{r3c}%
     \stepcounter{r4b}%
   \fi%
@@ -1064,11 +1067,11 @@ bookmarks=true]%
   \foreach\c in {r3,r3b,r3c}%
     {\ifnum\value{\c}>3\setcounter{\c}{1}\fi}%
   \foreach\c in {r4,r4b}%
-    {\ifnum\value{\c}>4\setcounter{\c}{1}\fi}%
+    {\ifnum\value{\c}>4\setcounter{\c}{1}\stepcounter{rn1t2}\fi}%
   \ifnum\value{r0t1}>1\setcounter{r0t1}{0}\fi%
   \ifnum\value{rn1t0}>0\setcounter{rn1t0}{-1}\fi%
+  \ifnum\value{r2t3}>3\setcounter{r2t3}{2}\stepcounter{rn1t2}\fi%
   \ifnum\value{rn1t2}>2\setcounter{rn1t2}{-1}\fi%
-  \ifnum\value{r2t3}>3\setcounter{r2t3}{2}\fi%
   \ifnum\value{r2t4}>4\setcounter{r2t4}{2}\fi%
   \ifnum\value{r3t4}>4\setcounter{r3t4}{3}\fi%
   \ifnum\value{r4t5}>5\setcounter{r4t5}{4}\fi%
diff --git a/market.sty b/market.sty
index 7f9b84b6edf18fb097ff7baa6780134cbd55726c..224927a4d29cd5b7a7c541633f9c0dac730112b3 100644
--- a/market.sty
+++ b/market.sty
@@ -8,7 +8,8 @@
   \else%
     \addtocounter{track}{\value{rn3t3}}%
     \ifnum\value{track}<14%
-      \addtocounter{track}{\value{r4b}}%
+      \addtocounter{track}{\value{r3b}}%
+      \addtocounter{track}{\value{rn1t2}}%
     \else%
       \ifnum\value{track}<34%
         \addtocounter{track}{\value{r4t6}}%
diff --git a/test.tex b/test.tex
index 7efadb95dff5a2262c2212caec40e25b967f28b2..aa0e463b9d134ccc3992543d909f361aa8b5d950 100644
--- a/test.tex
+++ b/test.tex
@@ -89,6 +89,42 @@ Words are needed after each subsection to avoid the boxes making problems.
 
 \end{multicols}
 
+\newcommand\showCounters{
+  \arabic{r2} &
+  \arabic{r2b} &
+  \arabic{r2c} &
+  \arabic{r3} &
+  \arabic{r3b} &
+  \arabic{r3c} &
+  \arabic{r4} &
+  \arabic{r4b} &
+  \arabic{r0t1} &
+  \arabic{rn1t0} &
+  \arabic{rn1t2} &
+  \arabic{rn3t3} &
+  \arabic{r2t3} &
+  \arabic{r2t4} &
+  \arabic{r3t4} &
+  \arabic{r4t5} &
+  \arabic{r4t6}
+  \randomize
+  \\
+}
+
+\begin{tabular}{cccccccccccccccccc}
+  \textbf{r2} & \textbf{r2b} & \textbf{r2c} & \textbf{r3} & \textbf{r3b} & \textbf{r3c} & \textbf{r4} & \textbf{r4b} & \textbf{r0t1} & \textbf{rn1t0} & \textbf{rn1t2} & \textbf{rn3t3} & \textbf{r2t3} & \textbf{r2t4} & \textbf{r3t4} & \textbf{r4t5} & \textbf{r4t6} \\\hline
+  \showCounters
+  \showCounters
+  \showCounters
+  \showCounters
+  \showCounters
+  \showCounters
+  \showCounters
+  \showCounters
+  \showCounters
+  \showCounters
+\end{tabular}
+
 \mainmatter
 
 \chapter{Side Quests}