diff --git a/Network/XmlRpc/Base64.hs b/Network/XmlRpc/Base64.hs
--- a/Network/XmlRpc/Base64.hs
+++ b/Network/XmlRpc/Base64.hs
@@ -3,8 +3,11 @@
     decode
 ) where
 
-import qualified Codec.Binary.Base64 as B64
-import Data.Maybe
+import           Data.ByteString
+import qualified Data.ByteString.Base64 as B64
 
+encode :: ByteString -> ByteString
 encode = B64.encode
-decode = fromJust . B64.decode
+
+decode :: ByteString -> ByteString
+decode = B64.decodeLenient
diff --git a/Network/XmlRpc/Client.hs b/Network/XmlRpc/Client.hs
--- a/Network/XmlRpc/Client.hs
+++ b/Network/XmlRpc/Client.hs
@@ -3,7 +3,7 @@
 -- Module      :  Network.XmlRpc.Client
 -- Copyright   :  (c) Bjorn Bringert 2003
 -- License     :  BSD-style
--- 
+--
 -- Maintainer  :  bjorn@bringert.net
 -- Stability   :  experimental
 -- Portability :  non-portable (requires extensions and non-portable libraries)
@@ -19,7 +19,7 @@
 -- >
 -- > add :: String -> Int -> Int -> IO Int
 -- > add url = remote url "examples.add"
--- > 
+-- >
 -- > main = do
 -- >        let x = 4
 -- >            y = 7
@@ -48,9 +48,9 @@
 import Network.HTTP
 import Network.Stream
 
-import Data.ByteString.Lazy.Char8 (ByteString, toChunks, fromChunks)
+import qualified Data.ByteString.Lazy.Char8 as BSL (ByteString, toChunks)
 import qualified Data.ByteString.UTF8 as U
-import qualified Data.ByteString as BS
+import qualified Data.ByteString.Char8 as BS
 
 -- | Gets the return value from a method response.
 --   Throws an exception if the response was a fault.
@@ -61,8 +61,8 @@
 -- | Sends a method call to a server and returns the response.
 --   Throws an exception if the response was an error.
 doCall :: String -> MethodCall -> Err IO MethodResponse
-doCall url mc = 
-    do 
+doCall url mc =
+    do
     let req = renderCall mc
     --FIXME: remove
     --putStrLn req
@@ -72,7 +72,7 @@
     parseResponse resp
 
 -- | Low-level method calling function. Use this function if
---   you need to do custom conversions between XML-RPC types and 
+--   you need to do custom conversions between XML-RPC types and
 --   Haskell types.
 --   Throws an exception if the response was a fault.
 call :: String -- ^ URL for the XML-RPC server.
@@ -83,19 +83,19 @@
 
 
 -- | Call a remote method.
-remote :: Remote a => 
+remote :: Remote a =>
 	  String -- ^ Server URL. May contain username and password on
 	         --   the format username:password\@ before the hostname.
        -> String -- ^ Remote method name.
-       -> a      -- ^ Any function 
-		 -- @(XmlRpcType t1, ..., XmlRpcType tn, XmlRpcType r) => 
+       -> a      -- ^ Any function
+		 -- @(XmlRpcType t1, ..., XmlRpcType tn, XmlRpcType r) =>
                  -- t1 -> ... -> tn -> IO r@
 remote u m = remote_ (\e -> "Error calling " ++ m ++ ": " ++ e) (call u m)
 
 class Remote a where
     remote_ :: (String -> String)        -- ^ Will be applied to all error
 					 --   messages.
-	    -> ([Value] -> Err IO Value) 
+	    -> ([Value] -> Err IO Value)
 	    -> a
 
 instance XmlRpcType a => Remote (IO a) where
@@ -121,7 +121,7 @@
 -- | Post some content to a uri, return the content of the response
 --   or an error.
 -- FIXME: should we really use fail?
-post :: String -> ByteString -> IO String
+post :: String -> BSL.ByteString -> IO String
 post url content = do
     uri <- maybeFail ("Bad URI: '" ++ url ++ "'") (parseURI url)
     let a = uriAuthority uri
@@ -132,10 +132,10 @@
 -- | Post some content to a uri, return the content of the response
 --   or an error.
 -- FIXME: should we really use fail?
-post_ :: URI -> URIAuth -> ByteString -> IO String
-post_ uri auth content = 
+post_ :: URI -> URIAuth -> BSL.ByteString -> IO String
+post_ uri auth content =
     do
-    eresp <- simpleHTTP (request uri auth (BS.concat . toChunks $ content))
+    eresp <- simpleHTTP (request uri auth (BS.concat . BSL.toChunks $ content))
     resp <- handleE (fail . show) eresp
     case rspCode resp of
 		      (2,0,0) -> return (U.toString (rspBody resp))
@@ -146,9 +146,9 @@
 
 -- | Create an XML-RPC compliant HTTP request.
 request :: URI -> URIAuth -> BS.ByteString -> Request BS.ByteString
-request uri auth content = Request{ rqURI = uri, 
-				    rqMethod = POST, 
-				    rqHeaders = headers, 
+request uri auth content = Request{ rqURI = uri,
+				    rqMethod = POST,
+				    rqHeaders = headers,
 				    rqBody = content }
     where
     -- the HTTP module adds a Host header based on the URI
@@ -160,19 +160,16 @@
                          in ( if null u then Nothing else Just u
                             , if null pw then Nothing else Just (tail pw))
 
--- | Creates an Authorization header using the Basic scheme, 
+-- | Creates an Authorization header using the Basic scheme,
 --   see RFC 2617 section 2.
 authHdr :: Maybe String -- ^ User name, if any
 	-> Maybe String -- ^ Password, if any
-	-> Maybe Header -- ^ If user name or password was given, returns 
+	-> Maybe Header -- ^ If user name or password was given, returns
 	                --   an Authorization header, otherwise 'Nothing'
 authHdr Nothing Nothing = Nothing
 authHdr u p = Just (Header HdrAuthorization ("Basic " ++ base64encode user_pass))
-	where user_pass = fromMaybe "" u ++ ":" ++ fromMaybe "" p
-	      base64encode = Base64.encode . stringToOctets
-	      -- FIXME: this probably only works right for latin-1 strings
-	      stringToOctets :: String -> [Word8]
-	      stringToOctets = map (fromIntegral . fromEnum)
+	where user_pass    = fromMaybe "" u ++ ":" ++ fromMaybe "" p
+	      base64encode = BS.unpack . Base64.encode . BS.pack
 
 --
 -- Utility functions
diff --git a/Network/XmlRpc/Internals.hs b/Network/XmlRpc/Internals.hs
--- a/Network/XmlRpc/Internals.hs
+++ b/Network/XmlRpc/Internals.hs
@@ -3,12 +3,12 @@
 -- Module      :  Network.XmlRpc.Internals
 -- Copyright   :  (c) Bjorn Bringert 2003
 -- License     :  BSD-style
--- 
+--
 -- Maintainer  :  bjorn@bringert.net
 -- Stability   :  experimental
 -- Portability :  non-portable (requires extensions and non-portable libraries)
 --
--- This module contains the core functionality of the XML-RPC library. 
+-- This module contains the core functionality of the XML-RPC library.
 -- Most applications should not need to use this module. Client
 -- applications should use "Network.XmlRpc.Client" and server applications should
 -- use "Network.XmlRpc.Server".
@@ -22,38 +22,40 @@
 MethodCall(..), MethodResponse(..),
 -- * XML-RPC types
 Value(..), Type(..), XmlRpcType(..),
--- * Converting from XML 
+-- * Converting from XML
 parseResponse, parseCall, getField, getFieldMaybe,
--- * Converting to XML 
+-- * Converting to XML
 renderCall, renderResponse,
 -- * Error monad
 Err, maybeToM, handleError, ioErrorToErr
 ) where
 
-import Prelude hiding (showString, catch)
-import Control.Monad
-import Data.Maybe
-import Data.List
-import Data.Time.Calendar
-import Data.Time.Calendar.WeekDate (toWeekDate)
-import Data.Time.Calendar.OrdinalDate (toOrdinalDate)
-import Data.Time.LocalTime
-import Data.Time.Format
-import Data.Word (Word8)
-import Numeric (showFFloat)
-import Data.Char
-import System.Time (CalendarTime(..))
-import System.Locale
-import Control.Exception
-import Control.Monad.Error
-import Control.Monad.Identity
-import System.IO.Unsafe (unsafePerformIO)
+import           Control.Exception
+import           Control.Monad
+import           Control.Monad.Error
+import           Control.Monad.Identity
+import           Data.Char (chr, ord)
+import           Data.Char
+import           Data.List
+import           Data.Maybe
+import           Data.Time.Calendar
+import           Data.Time.Calendar.OrdinalDate (toOrdinalDate)
+import           Data.Time.Calendar.WeekDate (toWeekDate)
+import           Data.Time.Format
+import           Data.Time.LocalTime
+import           Data.Word (Word8)
+import           Numeric (showFFloat)
+import           Prelude hiding (showString, catch)
+import           System.IO.Unsafe (unsafePerformIO)
+import           System.Locale
+import           System.Time (CalendarTime(..))
 
-import Text.XML.HaXml.XmlContent
-import Network.XmlRpc.Pretty
-import Data.ByteString.Lazy.Char8 (ByteString, pack)
+import qualified Data.ByteString.Char8 as BS (ByteString, pack, unpack)
+import qualified Data.ByteString.Lazy.Char8 as BSL (ByteString, pack)
 import qualified Network.XmlRpc.Base64 as Base64
 import qualified Network.XmlRpc.DTD_XMLRPC as XR
+import           Network.XmlRpc.Pretty
+import           Text.XML.HaXml.XmlContent
 
 --
 -- General utilities
@@ -61,7 +63,7 @@
 
 -- | Replaces all occurances of a sublist in a list with another list.
 --   If the list to replace is the empty list, does nothing.
-replace :: Eq a => 
+replace :: Eq a =>
 	[a] -- ^ The sublist to replace when found
 	-> [a] -- ^ The list to replace it with
 	-> [a] -- ^ The list to replace in
@@ -73,7 +75,7 @@
     | otherwise = x : replace ys zs xs'
 
 -- | Convert a 'Maybe' value to a value in any monad
-maybeToM :: Monad m =>  
+maybeToM :: Monad m =>
 		String -- ^ Error message to fail with for 'Nothing'
 	     -> Maybe a -- ^ The 'Maybe' value.
 	     -> m a -- ^ The resulting value in the monad.
@@ -109,11 +111,11 @@
 
 -- | Handle errors from the error monad.
 handleError :: Monad m => (String -> m a) -> Err m a -> m a
-handleError h m = do 
+handleError h m = do
 		  Right x <- runErrorT (catchError m (lift . h))
 		  return x
 
-errorRead :: (Monad m, Read a) => 
+errorRead :: (Monad m, Read a) =>
 	     ReadS a -- ^ Parser
 	  -> String -- ^ Error message
 	  -> String -- ^ String to parse
@@ -122,9 +124,9 @@
 		          [x] -> return x
 		          _   -> fail (err ++ ": '" ++ s ++ "'")
 
--- | Convert an 'Int' to some instance of 'Enum', and fail if the 
+-- | Convert an 'Int' to some instance of 'Enum', and fail if the
 --   'Int' is out of range.
-errorToEnum :: (Monad m, Bounded a, Enum a) => 
+errorToEnum :: (Monad m, Bounded a, Enum a) =>
 	       String -- ^ Error message
 	    -> Int
 	    -> Err m a
@@ -137,30 +139,30 @@
 -- Types for methods calls and responses
 --
 
--- | An XML-RPC method call. Consists of a method name and a list of 
+-- | An XML-RPC method call. Consists of a method name and a list of
 --   parameters.
 data MethodCall = MethodCall String [Value]
-		  deriving (Eq, Show) -- for debugging 
+		  deriving (Eq, Show) -- for debugging
 
 -- | An XML-RPC response.
 data MethodResponse = Return Value -- ^ A method response returning a value
 		    | Fault Int String -- ^ A fault response
-		      deriving (Eq, Show) -- for debugging 
+		      deriving (Eq, Show) -- for debugging
 
 -- | An XML-RPC value.
-data Value = 
+data Value =
       ValueInt Int -- ^ int or i4
     | ValueBool Bool -- ^ bool
     | ValueString String -- ^ string
     | ValueDouble Double -- ^ double
     | ValueDateTime LocalTime -- ^ dateTime.iso8601
-    | ValueBase64 String -- ^ base 64
+    | ValueBase64 BS.ByteString -- ^ base 64.  NOTE that you should provide the raw data; the haxr library takes care of doing the base-64 encoding.
     | ValueStruct [(String,Value)] -- ^ struct
     | ValueArray [Value]  -- ^ array
-      deriving (Eq, Show) -- for debugging 
+      deriving (Eq, Show) -- for debugging
 
 -- | An XML-RPC value. Use for error messages and introspection.
-data Type = 
+data Type =
 	  TInt
 	  | TBool
 	  | TString
@@ -196,11 +198,11 @@
 
 -- | Gets the value of a struct member
 structGetValue :: Monad m => String -> Value -> Err m Value
-structGetValue n (ValueStruct t) = 
+structGetValue n (ValueStruct t) =
     maybeToM ("Unknown member '" ++ n ++ "'") (lookup n t)
 structGetValue _ _ = fail "Value is not a struct"
 
--- | Builds a fault struct 
+-- | Builds a fault struct
 faultStruct :: Int -> String -> Value
 faultStruct code str = ValueStruct [("faultCode",ValueInt code),
 				    ("faultString",ValueString str)]
@@ -209,9 +211,9 @@
 -- "The body of the response is a single XML structure, a
 -- <methodResponse>, which can contain a single <params> which contains a
 -- single <param> which contains a single <value>."
-onlyOneResult :: Monad m => [Value] -> Err m Value 
-onlyOneResult [] = fail "Method returned no result" 
-onlyOneResult [x] = return x 
+onlyOneResult :: Monad m => [Value] -> Err m Value
+onlyOneResult [] = fail "Method returned no result"
+onlyOneResult [x] = return x
 onlyOneResult _ = fail "Method returned more than one result"
 
 --
@@ -229,18 +231,18 @@
 
 typeError :: (XmlRpcType a, Monad m) => Value -> Err m a
 typeError v = withType $ \t ->
-       fail ("Wanted: "  
+       fail ("Wanted: "
 	     ++ show (getType t)
-	     ++ "', got: '" 
+	     ++ "', got: '"
 	     ++ showXml False (toXRValue v) ++ "'") `asTypeOf` return t
 
 -- a type hack for use in 'typeError'
 withType :: (a -> Err m a) -> Err m a
 withType f = f undefined
 
-simpleFromValue :: (Monad m, XmlRpcType a) => (Value -> Maybe a) 
+simpleFromValue :: (Monad m, XmlRpcType a) => (Value -> Maybe a)
 		-> Value -> Err m a
-simpleFromValue f v = 
+simpleFromValue f v =
     maybe (typeError v) return (f v)
 
 
@@ -271,10 +273,16 @@
     toValue = ValueString
     fromValue = simpleFromValue f
 	where f (ValueString x) = Just x
-	      f (ValueBase64 x) = Just x
 	      f _ = Nothing
     getType _ = TString
 
+instance XmlRpcType BS.ByteString where
+    toValue = ValueBase64
+    fromValue = simpleFromValue f
+        where f (ValueBase64 x) = Just x
+              f _ = Nothing
+    getType _ = TBase64
+
 instance XmlRpcType Double where
     toValue = ValueDouble
     fromValue = simpleFromValue f
@@ -296,7 +304,7 @@
 
 -- FIXME: array elements may have different types
 instance XmlRpcType a => XmlRpcType [a] where
-    toValue = ValueArray . map toValue 
+    toValue = ValueArray . map toValue
     fromValue v = case v of
 			 ValueArray xs -> mapM fromValue xs
 			 _ -> typeError v
@@ -312,28 +320,28 @@
     getType _ = TStruct
 
 -- Tuple instances may be used for heterogenous array types.
-instance (XmlRpcType a, XmlRpcType b, XmlRpcType c, XmlRpcType d, 
-          XmlRpcType e) => 
+instance (XmlRpcType a, XmlRpcType b, XmlRpcType c, XmlRpcType d,
+          XmlRpcType e) =>
          XmlRpcType (a,b,c,d,e) where
-    toValue (v,w,x,y,z) = 
+    toValue (v,w,x,y,z) =
         ValueArray [toValue v, toValue w, toValue x, toValue y, toValue z]
-    fromValue (ValueArray [v,w,x,y,z]) = 
-        liftM5 (,,,,) (fromValue v) (fromValue w) (fromValue x) 
-                      (fromValue y) (fromValue z) 
+    fromValue (ValueArray [v,w,x,y,z]) =
+        liftM5 (,,,,) (fromValue v) (fromValue w) (fromValue x)
+                      (fromValue y) (fromValue z)
     fromValue _ = throwError "Expected 5-element tuple!"
     getType _ = TArray
 
-instance (XmlRpcType a, XmlRpcType b, XmlRpcType c, XmlRpcType d) => 
+instance (XmlRpcType a, XmlRpcType b, XmlRpcType c, XmlRpcType d) =>
          XmlRpcType (a,b,c,d) where
     toValue (w,x,y,z) = ValueArray [toValue w, toValue x, toValue y, toValue z]
-    fromValue (ValueArray [w,x,y,z]) = 
+    fromValue (ValueArray [w,x,y,z]) =
         liftM4 (,,,) (fromValue w) (fromValue x) (fromValue y) (fromValue z)
     fromValue _ = throwError "Expected 4-element tuple!"
     getType _ = TArray
 
 instance (XmlRpcType a, XmlRpcType b, XmlRpcType c) => XmlRpcType (a,b,c) where
     toValue (x,y,z) = ValueArray [toValue x, toValue y, toValue z]
-    fromValue (ValueArray [x,y,z]) = 
+    fromValue (ValueArray [x,y,z]) =
         liftM3 (,,) (fromValue x) (fromValue y) (fromValue z)
     fromValue _ = throwError "Expected 3-element tuple!"
     getType _ = TArray
@@ -345,19 +353,19 @@
     getType _ = TArray
 
 -- | Get a field value from a (possibly heterogeneous) struct.
-getField :: (Monad m, XmlRpcType a) => 
+getField :: (Monad m, XmlRpcType a) =>
 	    String           -- ^ Field name
 	 -> [(String,Value)] -- ^ Struct
 	 -> Err m a
-getField x xs = maybeToM ("struct member " ++ show x ++ " not found") 
+getField x xs = maybeToM ("struct member " ++ show x ++ " not found")
 		(lookup x xs) >>= fromValue
 
 -- | Get a field value from a (possibly heterogeneous) struct.
-getFieldMaybe :: (Monad m, XmlRpcType a) => 
+getFieldMaybe :: (Monad m, XmlRpcType a) =>
 	    String           -- ^ Field name
 	 -> [(String,Value)] -- ^ Struct
 	 -> Err m (Maybe a)
-getFieldMaybe x xs = case lookup x xs of 
+getFieldMaybe x xs = case lookup x xs of
 				      Nothing -> return Nothing
 				      Just v -> liftM Just (fromValue v)
 
@@ -370,11 +378,11 @@
 toXRValue (ValueBool b) = XR.Value [XR.Value_Boolean (XR.Boolean (showBool b))]
 toXRValue (ValueString s) = XR.Value [XR.Value_AString (XR.AString (showString s))]
 toXRValue (ValueDouble d) = XR.Value [XR.Value_ADouble (XR.ADouble (showDouble d))]
-toXRValue (ValueDateTime t) = 
+toXRValue (ValueDateTime t) =
    XR.Value [ XR.Value_DateTime_iso8601 (XR.DateTime_iso8601 (showDateTime t))]
 toXRValue (ValueBase64 s) = XR.Value [XR.Value_Base64 (XR.Base64 (showBase64 s))]
 toXRValue (ValueStruct xs) = XR.Value [XR.Value_Struct (XR.Struct (map toXRMember xs))]
-toXRValue (ValueArray xs) = 
+toXRValue (ValueArray xs) =
     XR.Value [XR.Value_Array (XR.Array (XR.Data (map toXRValue xs)))]
 
 showInt :: Int -> String
@@ -395,24 +403,19 @@
 showDateTime :: LocalTime -> String
 showDateTime t = formatTime defaultTimeLocale xmlRpcDateFormat t
 
-showBase64 :: String -> String
-showBase64 = Base64.encode . stringToOctets
-    where
-        -- FIXME: this probably only works right for latin-1 strings
-	stringToOctets :: String -> [Word8]
-	stringToOctets = map (fromIntegral . fromEnum)
-
+showBase64 :: BS.ByteString -> String
+showBase64 = BS.unpack . Base64.encode
 
 toXRMethodCall :: MethodCall -> XR.MethodCall
-toXRMethodCall (MethodCall name vs) = 
+toXRMethodCall (MethodCall name vs) =
     XR.MethodCall (XR.MethodName name) (Just (toXRParams vs))
 
 toXRMethodResponse :: MethodResponse -> XR.MethodResponse
 toXRMethodResponse (Return val) = XR.MethodResponseParams (toXRParams [val])
-toXRMethodResponse (Fault code str) = 
+toXRMethodResponse (Fault code str) =
     XR.MethodResponseFault (XR.Fault (toXRValue (faultStruct code str)))
 
-toXRParams :: [Value] -> XR.Params 
+toXRParams :: [Value] -> XR.Params
 toXRParams vs = XR.Params (map (XR.Param . toXRValue) vs)
 
 toXRMember :: (String, Value) -> XR.Member
@@ -441,10 +444,10 @@
   f (XR.Value_DateTime_iso8601 (XR.DateTime_iso8601 x)) =
     liftM ValueDateTime (readDateTime x)
   f (XR.Value_Base64 (XR.Base64 x)) = liftM ValueBase64 (readBase64 x)
-  f (XR.Value_Struct (XR.Struct ms)) = 
-    liftM ValueStruct (mapM fromXRMember ms) 
-  f (XR.Value_Array (XR.Array (XR.Data xs))) = 
-    liftM ValueArray (mapM fromXRValue xs) 
+  f (XR.Value_Struct (XR.Struct ms)) =
+    liftM ValueStruct (mapM fromXRMember ms)
+  f (XR.Value_Array (XR.Array (XR.Data xs))) =
+    liftM ValueArray (mapM fromXRValue xs)
 
 
 fromXRMember :: Monad m => XR.Member -> Err m (String,Value)
@@ -476,7 +479,7 @@
 -- \"Any characters are allowed in a string except \< and &, which are
 -- encoded as &lt; and &amp;. A string can be used to encode binary data.\"
 --
--- To work with implementations (such as some Python bindings for example) 
+-- To work with implementations (such as some Python bindings for example)
 -- which also escape \>, &gt; is unescaped. This is non-standard, but
 -- seems unlikely to cause problems.
 readString :: Monad m => String -> Err m String
@@ -485,7 +488,7 @@
 
 
 -- | From the XML-RPC specification:
--- 
+--
 -- There is no representation for infinity or negative infinity or \"not
 -- a number\". At this time, only decimal point notation is allowed, a
 -- plus or a minus, followed by any number of numeric characters,
@@ -511,7 +514,7 @@
         (parseTime defaultTimeLocale xmlRpcDateFormat dt)
 
 localTimeToCalendarTime :: LocalTime -> CalendarTime
-localTimeToCalendarTime l = 
+localTimeToCalendarTime l =
     let (y,mo,d) = toGregorian (localDay l)
         TimeOfDay { todHour = h, todMin = mi, todSec = s } = localTimeOfDay l
         (_,_,wd) = toWeekDate (localDay l)
@@ -532,32 +535,27 @@
 		     }
 
 calendarTimeToLocalTime :: CalendarTime -> LocalTime
-calendarTimeToLocalTime ct = 
+calendarTimeToLocalTime ct =
     let (y,mo,d) = (ctYear ct, ctMonth ct, ctDay ct)
         (h,mi,s) = (ctHour ct, ctMin ct, ctSec ct)
-     in LocalTime { 
-                   localDay = fromGregorian (fromIntegral y) (fromEnum mo + 1) d, 
+     in LocalTime {
+                   localDay = fromGregorian (fromIntegral y) (fromEnum mo + 1) d,
                    localTimeOfDay = TimeOfDay { todHour = h, todMin = mi, todSec = fromIntegral s }
                   }
 
 -- FIXME: what if data contains non-base64 characters?
-readBase64 :: Monad m => String -> Err m String
-readBase64 = return . octetsToString . Base64.decode
-    where
-        -- FIXME: this probably only works right for latin-1 strings
-	octetsToString :: [Word8] -> String
-	octetsToString = map (toEnum . fromIntegral)
-
+readBase64 :: Monad m => String -> Err m BS.ByteString
+readBase64 = return . Base64.decode . BS.pack
 
 fromXRParams :: Monad m => XR.Params -> Err m [Value]
 fromXRParams (XR.Params xps) = mapM (\(XR.Param v) -> fromXRValue v) xps
 
 fromXRMethodCall :: Monad m => XR.MethodCall -> Err m MethodCall
-fromXRMethodCall (XR.MethodCall (XR.MethodName name) params) = 
+fromXRMethodCall (XR.MethodCall (XR.MethodName name) params) =
     liftM (MethodCall name) (fromXRParams (fromMaybe (XR.Params []) params))
 
 fromXRMethodResponse :: Monad m => XR.MethodResponse -> Err m MethodResponse
-fromXRMethodResponse (XR.MethodResponseParams xps) = 
+fromXRMethodResponse (XR.MethodResponseParams xps) =
     liftM Return (fromXRParams xps >>= onlyOneResult)
 fromXRMethodResponse (XR.MethodResponseFault (XR.Fault v)) =
     do
@@ -570,11 +568,11 @@
 
 --
 -- Parsing calls and reponses from XML
---     
+--
 
 -- | Parses a method call from XML.
 parseCall :: (Show e, MonadError e m) => String -> Err m MethodCall
-parseCall c = 
+parseCall c =
     do
     mxc <- errorToErr (readXml c)
     xc <- eitherToM "Error parsing method call" mxc
@@ -582,7 +580,7 @@
 
 -- | Parses a method response from XML.
 parseResponse :: (Show e, MonadError e m) => String -> Err m MethodResponse
-parseResponse c = 
+parseResponse c =
     do
     mxr <- errorToErr (readXml c)
     xr <- eitherToM "Error parsing method response" mxr
@@ -594,15 +592,15 @@
 
 -- | Makes an XML-representation of a method call.
 -- FIXME: pretty prints ugly XML
-renderCall :: MethodCall -> ByteString
+renderCall :: MethodCall -> BSL.ByteString
 renderCall = showXml' False . toXRMethodCall
 
 -- | Makes an XML-representation of a method response.
 -- FIXME: pretty prints ugly XML
-renderResponse :: MethodResponse -> ByteString
+renderResponse :: MethodResponse -> BSL.ByteString
 renderResponse  = showXml' False . toXRMethodResponse
 
-showXml' :: XmlContent a => Bool -> a -> ByteString
+showXml' :: XmlContent a => Bool -> a -> BSL.ByteString
 showXml' dtd x = case toContents x of
                    [CElem _ _] -> (document . toXml dtd) x
-                   _ -> pack ""
+                   _ -> BSL.pack ""
diff --git a/haxr.cabal b/haxr.cabal
--- a/haxr.cabal
+++ b/haxr.cabal
@@ -1,12 +1,12 @@
 Name: haxr
-Version: 3000.8.5
+Version: 3000.9
 Cabal-version: >=1.6
 Build-type: Simple
 Copyright: Bjorn Bringert, 2003-2006
 License: BSD3
 License-file: LICENSE
 Author: Bjorn Bringert <bjorn@bringert.net>
-Maintainer: Gracjan Polak <gracjanpolak@gmail.com>
+Maintainer: Brent Yorgey <byorgey@gmail.com>
 Homepage: http://www.haskell.org/haskellwiki/HaXR
 Category: Network
 Synopsis: XML-RPC client and server library.
@@ -21,14 +21,18 @@
         examples/test_client.hs       examples/test_server.hs       examples/time-xmlrpc-com.hs
         examples/validate.hs          examples/Makefile
 
+Source-repository head
+  type:     darcs
+  location: http://code.haskell.org/haxr
+
 Library
   Build-depends: base < 5,
                  mtl,
                  network < 3,
-                 HaXml == 1.22.*,
+                 HaXml >= 1.22 && < 1.24,
                  HTTP >= 4000,
                  bytestring,
-                 dataenc,
+                 base64-bytestring,
                  old-locale,
                  old-time,
                  time,
