diff --git a/hw-rankselect.cabal b/hw-rankselect.cabal
--- a/hw-rankselect.cabal
+++ b/hw-rankselect.cabal
@@ -1,14 +1,12 @@
--- This file has been generated from package.yaml by hpack version 0.27.0.
+-- This file has been generated from package.yaml by hpack version 0.18.1.
 --
 -- see: https://github.com/sol/hpack
---
--- hash: 1a884e08d826a4ac01f16811763a63e54433817022a52322a43feb446d2b9e13
 
 name:           hw-rankselect
-version:        0.12.0.3
+version:        0.12.0.4
 synopsis:       Rank-select
 description:    Please see README.md
-category:       Data, Conduit
+category:       Data, Bit, Succinct Data Structures, Data Structures
 homepage:       http://github.com/haskell-works/hw-rankselect#readme
 bug-reports:    https://github.com/haskell-works/hw-rankselect/issues
 author:         John Ky
@@ -35,32 +33,53 @@
   default: False
 
 library
-  exposed-modules:
-      HaskellWorks.Data.RankSelect.CsPoppy
-      HaskellWorks.Data.RankSelect.CsPoppy.Internal
-      HaskellWorks.Data.RankSelect.Poppy512
-  other-modules:
-      Paths_hw_rankselect
   hs-source-dirs:
       src
   ghc-options: -Wall -O2 -msse4.2
   build-depends:
-      base >=4 && <5
-    , deepseq >=1.4 && <1.5
-    , hw-balancedparens >=0.1.0.0 && <0.3
-    , hw-bits >=0.6.0.0 && <0.8
-    , hw-prim >=0.6 && <0.7
-    , hw-rankselect-base >=0.2.0.0 && <0.4
-    , vector >=0.12 && <0.13
+      hw-rankselect-base    >= 0.2.0.0    && < 0.4
+    , vector                >= 0.12       && < 0.13
+    , base                >= 4          && < 5
+    , deepseq             >= 1.4        && < 1.5
+    , hw-balancedparens   >= 0.1.0.0    && < 0.3
+    , hw-bits             >= 0.6.0.0    && < 0.8
+    , hw-prim             >= 0.6        && < 0.7
   if (flag(bmi2)) && (impl(ghc >=8.4.1))
     ghc-options: -mbmi2 -msse4.2
     cpp-options: -DBMI2_ENABLED
-  if (impl(ghc >=8.0.1))
+  if (impl(ghc >= 8.0.1))
     ghc-options: -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints
+  exposed-modules:
+      HaskellWorks.Data.RankSelect.CsPoppy
+      HaskellWorks.Data.RankSelect.CsPoppy.Internal
+      HaskellWorks.Data.RankSelect.Poppy512
+  other-modules:
+      Paths_hw_rankselect
   default-language: Haskell2010
 
 executable hw-rankselect
   main-is: Main.hs
+  hs-source-dirs:
+      app
+  default-extensions: OverloadedStrings TupleSections
+  ghc-options: -threaded -rtsopts -Wall -O2 -msse4.2
+  build-depends:
+      hw-rankselect-base    >= 0.2.0.0    && < 0.4
+    , vector                >= 0.12       && < 0.13
+    , base                  >= 4.7        && < 5
+    , directory             >= 1.2        && < 1.4
+    , hw-bits               >= 0.4.0.0    && < 0.8
+    , hw-prim               >= 0.4.0.0    && < 0.7
+    , hw-rankselect
+    , lens                  >= 4          && < 5
+    , mmap                  >= 0.5        && < 0.6
+    , mtl                   >= 2.2        && < 2.3
+    , optparse-applicative  >= 0.11       && < 0.15
+  if (flag(bmi2)) && (impl(ghc >=8.4.1))
+    ghc-options: -mbmi2 -msse4.2
+    cpp-options: -DBMI2_ENABLED
+  if (impl(ghc >= 8.0.1))
+    ghc-options: -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints
   other-modules:
       App.Commands
       App.Commands.Build
@@ -69,33 +88,34 @@
       App.Commands.SelectAll
       App.Commands.UnitTest
       App.Commands.Validate
-      Paths_hw_rankselect
+  default-language: Haskell2010
+
+test-suite hw-rankselect-test
+  type: exitcode-stdio-1.0
+  main-is: Spec.hs
   hs-source-dirs:
-      app
-  default-extensions: OverloadedStrings TupleSections
-  ghc-options: -threaded -rtsopts -Wall -O2 -msse4.2
+      test
+  ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
   build-depends:
-      base >=4.7 && <5
-    , directory >=1.2 && <1.4
-    , hw-bits >=0.4.0.0 && <0.8
-    , hw-prim >=0.4.0.0 && <0.7
+      hw-rankselect-base    >= 0.2.0.0    && < 0.4
+    , vector                >= 0.12       && < 0.13
+    , base                >= 4          && < 5
+    , QuickCheck          >= 2.10       && < 2.12
+    , directory           >= 1.2        && < 1.4
+    , hedgehog            >= 0.5        && < 0.7
+    , hspec               >= 2.4        && < 2.6
+    , hw-bits             >= 0.4.0.0    && < 0.8
+    , hw-hedgehog         >= 0.1.0.1    && < 0.2
+    , hw-hspec-hedgehog   >= 0.1        && < 0.2
+    , hw-prim             >= 0.5.0.4    && < 0.7
     , hw-rankselect
-    , hw-rankselect-base >=0.2.0.0 && <0.4
-    , lens >=4 && <5
-    , mmap >=0.5 && <0.6
-    , mtl >=2.2 && <2.3
-    , optparse-applicative >=0.11 && <0.15
-    , vector >=0.12 && <0.13
+    , mmap                >= 0.5        && < 0.6
+    , transformers        >= 0.4        && < 0.6
   if (flag(bmi2)) && (impl(ghc >=8.4.1))
     ghc-options: -mbmi2 -msse4.2
     cpp-options: -DBMI2_ENABLED
   if (impl(ghc >=8.0.1))
     ghc-options: -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints
-  default-language: Haskell2010
-
-test-suite hw-rankselect-test
-  type: exitcode-stdio-1.0
-  main-is: Spec.hs
   other-modules:
       HaskellWorks.Data.RankSelect.BasicGen
       HaskellWorks.Data.RankSelect.BinarySearchSpec
@@ -108,57 +128,31 @@
       HaskellWorks.Data.RankSelect.SpecCommon
       HaskellWorks.Data.RankSelect.ValidateSpec
       Test.Common
-      Paths_hw_rankselect
-  hs-source-dirs:
-      test
-  ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
-  build-depends:
-      QuickCheck >=2.10 && <2.12
-    , base >=4 && <5
-    , directory >=1.2 && <1.4
-    , hedgehog >=0.5 && <0.7
-    , hspec >=2.4 && <2.6
-    , hw-bits >=0.4.0.0 && <0.8
-    , hw-hedgehog >=0.1.0.1 && <0.2
-    , hw-hspec-hedgehog >=0.1 && <0.2
-    , hw-prim >=0.5.0.4 && <0.7
-    , hw-rankselect
-    , hw-rankselect-base >=0.2.0.0 && <0.4
-    , mmap >=0.5 && <0.6
-    , transformers >=0.4 && <0.6
-    , vector >=0.12 && <0.13
-  if (flag(bmi2)) && (impl(ghc >=8.4.1))
-    ghc-options: -mbmi2 -msse4.2
-    cpp-options: -DBMI2_ENABLED
-  if (impl(ghc >=8.0.1))
-    ghc-options: -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints
   default-language: Haskell2010
-  build-tool-depends: hspec-discover:hspec-discover
 
 benchmark bench
   type: exitcode-stdio-1.0
   main-is: Main.hs
-  other-modules:
-      Paths_hw_rankselect
   hs-source-dirs:
       bench
   ghc-options: -O2 -Wall -msse4.2
   build-depends:
-      base >=4 && <5
-    , bytestring >=0.10 && <0.11
-    , conduit >=1.2 && <1.4
-    , criterion >=1.1 && <1.5
-    , directory >=1.2 && <1.5
-    , hw-bits >=0.4.0.0 && <0.8
-    , hw-prim >=0.6.0.0 && <0.7
+      hw-rankselect-base    >= 0.2.0.0    && < 0.4
+    , vector                >= 0.12       && < 0.13
+    , base                  >= 4          && < 5
+    , bytestring            >= 0.10       && < 0.11
+    , conduit               >= 1.2        && < 1.4
+    , criterion             >= 1.1        && < 1.6
+    , directory             >= 1.2        && < 1.5
+    , hw-bits               >= 0.4.0.0    && < 0.8
+    , hw-prim               >= 0.6.0.0    && < 0.7
     , hw-rankselect
-    , hw-rankselect-base >=0.3.1.0 && <0.4
-    , mmap >=0.5 && <0.6
-    , resourcet >=1.1 && <1.3
-    , vector >=0.12 && <0.13
+    , hw-rankselect-base    >= 0.3.1.0    && < 0.4
+    , mmap                  >= 0.5        && < 0.6
+    , resourcet             >= 1.1        && < 1.3
   if (flag(bmi2)) && (impl(ghc >=8.4.1))
     ghc-options: -mbmi2 -msse4.2
     cpp-options: -DBMI2_ENABLED
-  if (impl(ghc >=8.0.1))
+  if (impl(ghc                >= 8.0.1))
     ghc-options: -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints
   default-language: Haskell2010
diff --git a/src/HaskellWorks/Data/RankSelect/CsPoppy.hs b/src/HaskellWorks/Data/RankSelect/CsPoppy.hs
--- a/src/HaskellWorks/Data/RankSelect/CsPoppy.hs
+++ b/src/HaskellWorks/Data/RankSelect/CsPoppy.hs
@@ -230,7 +230,7 @@
   {-# INLINE enclose #-}
 
 instance Rank0 CsPoppy where
-  rank0 rsbs p = p - rank0 rsbs p
+  rank0 rsbs p = p - rank1 rsbs p
   {-# INLINE rank0 #-}
 
 instance BalancedParens CsPoppy where
