diff --git a/AGI.cabal b/AGI.cabal
--- a/AGI.cabal
+++ b/AGI.cabal
@@ -7,7 +7,7 @@
      can be used to write external programs that interact with
      Asterisk. It is typically used for creating Interactive Voice
      Response (IVR) systems. 
-Version:        1.2.1
+Version:        1.2.2
 License:        BSD3
 License-File:   LICENSE
 Author:         Jeremy Shaw
diff --git a/Network/AGI.hs b/Network/AGI.hs
--- a/Network/AGI.hs
+++ b/Network/AGI.hs
@@ -230,8 +230,8 @@
                         case (mTimeout, mMaxDigits) of
                           (Nothing, Nothing) -> ""
                           (Just timeout, Nothing) ->  show timeout
-                          (Nothing, Just maxDigits) -> "2000 " ++ show maxDigits
-                          (Just timeout, Just maxDigits) -> show timeout ++" "++ show maxDigits
+                          (Nothing, Just maxDigits) -> " 2000 " ++ show maxDigits
+                          (Just timeout, Just maxDigits) -> " " ++ show timeout ++" "++ show maxDigits
 
     in
       do res <- sendRecv cmd
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+haskell-agi (1.2.2) unstable; urgency=low
+
+  * Fix bug in getData when specifying maxDigits or timeout
+
+ -- Jeremy Shaw <jeremy@n-heptane.com>  Fri, 04 Jul 2008 18:02:34 -0700
+
 haskell-agi (1.2.1) unstable; urgency=low
 
   * Added digitsToInteger
