diff --git a/srb2query.php b/srb2query.php
index 3c521bf8d74396a6f3792b252f2b88ea14989ce9..fb68d4de44dcbf426e64903010c8c94025d336ca 100644
--- a/srb2query.php
+++ b/srb2query.php
@@ -643,7 +643,9 @@ class SRB2Query
 			htmlentities(preg_replace('/[\x00-\x19\x7F-\xFF]/', '',
 				str_replace($codes, $alts, $s))) . '</span>';
 
-		for ($i = 0x00; $i <= 0x0F; ++$i)
+		// Doing this backward for a good reason; so that higher numbers get a
+		// chance to be matched!
+		for ($i = 0x0F; $i >= 0x00; --$i)
 		{
 			$s = str_replace($alts[$i],
 				'</span><span style="color:' . $this->colors[$i] . ';">',