diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,3 +1,9 @@
+4.5.2 [2022.06.17]
+------------------
+* Fix a bug that would cause `Numeric.AD.Mode.Reverse.diff` and
+  `Numeric.AD.Mode.Reverse.Double.diff` to compute different answers under
+  certain circumstances when `ad` was compiled with the `+ffi` flag.
+
 4.5.1 [2022.05.18]
 ------------------
 * Allow building with `transformers-0.6.*`.
diff --git a/ad.cabal b/ad.cabal
--- a/ad.cabal
+++ b/ad.cabal
@@ -1,5 +1,5 @@
 name:          ad
-version:       4.5.1
+version:       4.5.2
 license:       BSD3
 license-File:  LICENSE
 copyright:     (c) Edward Kmett 2010-2021,
@@ -203,6 +203,14 @@
 
   ghc-options: -fspec-constr -fdicts-cheap -O2
   x-docspec-extra-packages: distributive
+
+test-suite regression
+  default-language: Haskell2010
+  type: exitcode-stdio-1.0
+  main-is: Regression.hs
+  hs-source-dirs: tests
+  build-depends: ad, base, tasty, tasty-hunit
+  ghc-options: -fspec-constr -fdicts-cheap -O2
 
 benchmark blackscholes
   default-language: Haskell2010
diff --git a/cbits/tape.c b/cbits/tape.c
--- a/cbits/tape.c
+++ b/cbits/tape.c
@@ -104,7 +104,7 @@
         buffer[j] += v*y;
       }
     }
-    idx += pTape->offset;
+    idx += 1 + pTape->offset;
     pTape = pTape->prev;
   }
   
diff --git a/tests/Regression.hs b/tests/Regression.hs
new file mode 100644
--- /dev/null
+++ b/tests/Regression.hs
@@ -0,0 +1,25 @@
+module Main (main) where
+
+import qualified Numeric.AD.Mode.Reverse as R
+import qualified Numeric.AD.Mode.Reverse.Double as RD
+
+import Test.Tasty
+import Test.Tasty.HUnit
+
+main :: IO ()
+main = defaultMain tests
+
+tests :: TestTree
+tests = testGroup "Regression tests"
+  [ testCase "#97" $
+      assertBool "Reverse.diff and Reverse.Double.diff should behave identically" $
+      nearZero $ R.diff f (0 :: Double) - RD.diff f (0 :: Double)
+  ]
+
+-- Reverse.Double +ffi initializes the tape with a block of size 4096
+-- The large term in this function forces the allocation of an additional block
+f :: Num a => a -> a
+f = sum . replicate 5000
+
+nearZero :: (Fractional a, Ord a) => a -> Bool
+nearZero a = abs a <= 1e-12
