diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 ChangeLog
 
+v0.4.1.0 2024/05/01
+	(2024/03/19) PS1 - fixed a bug in dioph_int_assoc_prime.
+	(2022/01/07) PS1 - added an instance for OmegaRing (Matrix n n a).
+
 v0.4.0.0 2019/06/28
 	(2019/06/27) PS1 - fixed a compiler warning.
 	(2019/06/27) PS1 - use type class synonym to fix compiler warnings
diff --git a/Quantum/Synthesis/Diophantine.hs b/Quantum/Synthesis/Diophantine.hs
--- a/Quantum/Synthesis/Diophantine.hs
+++ b/Quantum/Synthesis/Diophantine.hs
@@ -267,7 +267,7 @@
     -- prime divisor that occurs as an odd power and is congruent to 7
     -- mod n.
     return Nothing
-  | otherwise = error "dioph_int_assoc_prime"
+  | otherwise = diverge -- If n is even and not 2, then it is not prime, so diverge.
   where
     n_mod_4 = n `mod` 4
     n_mod_8 = n `mod` 8
diff --git a/Quantum/Synthesis/GridProblems.hs b/Quantum/Synthesis/GridProblems.hs
--- a/Quantum/Synthesis/GridProblems.hs
+++ b/Quantum/Synthesis/GridProblems.hs
@@ -417,7 +417,7 @@
 -- 1. Assume that /x0/ and /y0/ are not too far from the origin (say,
 -- between -10 and 10). This is to avoid problems with numeric
 -- instability when /x0/ and /y0/ are much larger than /dx/ and /dy/,
--- respectively.  /y0/ are not too far from the origin.
+-- respectively.
 -- 
 -- 2. The function potentially returns some non-solutions, so the
 -- caller should test for accuracy.
diff --git a/Quantum/Synthesis/Matrix.hs b/Quantum/Synthesis/Matrix.hs
--- a/Quantum/Synthesis/Matrix.hs
+++ b/Quantum/Synthesis/Matrix.hs
@@ -457,6 +457,9 @@
 instance (ComplexRing a, Nat n) => ComplexRing (Matrix n n a) where
   i = scalarmult i 1
 
+instance (OmegaRing a, Nat n) => OmegaRing (Matrix n n a) where
+  omega = scalarmult omega 1
+
 -- ----------------------------------------------------------------------
 -- ** Operations on block matrices
 
diff --git a/newsynth.cabal b/newsynth.cabal
--- a/newsynth.cabal
+++ b/newsynth.cabal
@@ -7,7 +7,7 @@
 -- PVP summary:      +-+------- breaking API changes
 --                   | | +----- non-breaking API additions
 --                   | | | +--- code changes with no API change
-version:             0.4.0.0
+version:             0.4.1.0
 
 -- A short (one-line) description of the package.
 synopsis:            Exact and approximate synthesis of quantum circuits
@@ -60,7 +60,7 @@
 maintainer:          selinger@mathstat.dal.ca
 
 -- A copyright notice.
-copyright:           Copyright (c) 2012-2019 Neil J. Ross and Peter Selinger
+copyright:           Copyright (c) 2012-2024 Neil J. Ross and Peter Selinger
 
 -- A classification category for future use by the package catalogue
 -- Hackage. These categories have not yet been specified, but the
@@ -71,13 +71,15 @@
 build-type:          Custom
 
 -- Constraint on the version of Cabal needed to build this package.
-cabal-version:       >= 1.8
+cabal-version:       >= 1.10
 
 -- A list of additional files to be included in source distributions
 -- built with setup sdist.
 extra-source-files:  images/*.png ChangeLog
 
 library
+  default-language:    Haskell2010
+  
   -- Modules exported by the library.
   exposed-modules:     Quantum.Synthesis.Newsynth, Quantum.Synthesis.Matrix, Quantum.Synthesis.LaTeX, Quantum.Synthesis.RotationDecomposition, Quantum.Synthesis.ArcTan2, Quantum.Synthesis.EulerAngles, Quantum.Synthesis.EuclideanDomain, Quantum.Synthesis.SymReal, Quantum.Synthesis.Ring, Quantum.Synthesis.Clifford, Quantum.Synthesis.MultiQubitSynthesis, Quantum.Synthesis.CliffordT, Quantum.Synthesis.Ring.FixedPrec, Quantum.Synthesis.Ring.SymReal, Quantum.Synthesis.GridProblems Quantum.Synthesis.GridSynth Quantum.Synthesis.Diophantine Quantum.Synthesis.StepComp Quantum.Synthesis.ToReal Quantum.Synthesis.QuadraticEquation
   
@@ -85,15 +87,17 @@
   -- other-modules:       
   
   -- Other library packages from which modules are imported.
-  build-depends:       base >= 4.5 && < 5, random >= 1.0, fixedprec >= 0.2.2, containers >= 0.5
+  build-depends:       base >= 4.5 && < 5, random >= 1.0 && < 1.2, fixedprec >= 0.2.2 && < 0.3, containers >= 0.5 && < 0.7
 
   -- Additional options for GHC when the package is built with
   -- profiling enabled.
   ghc-prof-options:
 
   ghc-options:
-  
+
 executable gridsynth
+  default-language:    Haskell2010
+
   -- .hs or .lhs file containing the Main module.
   main-is:             gridsynth.hs
 
@@ -104,7 +108,8 @@
   other-modules:       CommandLine
   
   -- Other library packages from which modules are imported.
-  build-depends:       base >= 4.5 && < 5, random >= 1.0, time >= 1.4, newsynth
+  build-depends:       base >= 4.5 && < 5, random >= 1.0 && < 1.2, time >= 1.4 && < 1.9, newsynth
 
 custom-setup
-  setup-depends:       base >= 4.5, Cabal >= 1.8 && < 3, superdoc >= 0.1
+  setup-depends:       base >= 4.5 && < 5, Cabal >= 1.8 && < 3, superdoc >= 0.1
+
