diff --git a/HXQ.cabal b/HXQ.cabal
--- a/HXQ.cabal
+++ b/HXQ.cabal
@@ -1,6 +1,6 @@
 Cabal-Version:       >= 1.2
 Name:                HXQ
-Version:             0.20.0
+Version:             0.20.1
 Synopsis:            A Compiler from XQuery to Haskell
 Description:         
         HXQ is a fast and space-efficient compiler from XQuery (the standard
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
 # set base3 to true for base-3 ghc (old ghc)
 # set extras to -rtsopts for GHC > 7.0
 
-driver = mysql
+driver = none
 base3 = false
 extras =
 
diff --git a/db.html b/db.html
--- a/db.html
+++ b/db.html
@@ -7,7 +7,7 @@
 <body>
 <center>
 <h1>HXQ with Database Connectivity</h1>
-<h3>Download <a href="/HXQ-0.19.0.tar.gz">HXQ-0.19.0.tar.gz</a></h3>
+<h3>Download <a href="/HXQ-0.20.0.tar.gz">HXQ-0.20.0.tar.gz</a></h3>
 </center>
 <p>
 <h2>Installation Instructions (HXQ with database connectivity)</h2>
diff --git a/index.html b/index.html
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
 <body>
 <center>
 <h1>HXQ: A Compiler from XQuery to Haskell</h1>
-<h3>Download <a href="/HXQ-0.19.0.tar.gz">HXQ-0.19.0.tar.gz</a></h3>
+<h3>Download <a href="/HXQ-0.20.0.tar.gz">HXQ-0.20.0.tar.gz</a></h3>
 </center>
 <p>
 <h2>Description</h2>
@@ -117,7 +117,7 @@
 ghc --make xquery.hs -o xquery
 </pre>
 An alternative way of installing HXQ is to download and install all required packages one-by-one:
-First download <a href="/HXQ-0.19.0.tar.gz">HXQ version 0.19.0</a> and untar
+First download <a href="/HXQ-0.20.0.tar.gz">HXQ version 0.20.0</a> and untar
 it (using <tt>tar xfz</tt> on Linux/Mac
 or <a href="http://www.7-zip.org/">7z x</a> on Windows).  Then,
 you execute the following commands inside the HXQ directory:
diff --git a/release.html b/release.html
--- a/release.html
+++ b/release.html
@@ -10,6 +10,9 @@
 </center>
 <p>
 <dl>
+<dt> HXQ-0.20.0 (released on 01/07/16)</dt>
+<dd>
+<p>
 <dt> HXQ-0.19.0 (released on 01/09/10)</dt>
 <dd>
 <p>
diff --git a/src/Text/XML/HXQ/Parser.hs b/src/Text/XML/HXQ/Parser.hs
--- a/src/Text/XML/HXQ/Parser.hs
+++ b/src/Text/XML/HXQ/Parser.hs
@@ -4,8 +4,10 @@
 import Data.Char
 import qualified Data.Array as Happy_Data_Array
 import qualified GHC.Exts as Happy_GHC_Exts
+import Control.Applicative(Applicative(..))
+import Control.Monad (ap)
 
--- parser produced by Happy Version 1.18.6
+-- parser produced by Happy Version 1.19.5
 
 newtype HappyAbsSyn  = HappyAbsSyn HappyAny
 #if __GLASGOW_HASKELL__ >= 607
@@ -2284,12 +2286,19 @@
 	_ -> happyError' (tk:tks)
 	}
 
-happyError_ tk tks = happyError' (tk:tks)
+happyError_ 94# tk tks = happyError' tks
+happyError_ _ tk tks = happyError' (tk:tks)
 
 newtype HappyIdentity a = HappyIdentity a
 happyIdentity = HappyIdentity
 happyRunIdentity (HappyIdentity a) = a
 
+instance Functor HappyIdentity where
+    fmap f (HappyIdentity a) = HappyIdentity (f a)
+
+instance Applicative HappyIdentity where
+    pure  = return
+    (<*>) = ap
 instance Monad HappyIdentity where
     return = HappyIdentity
     (HappyIdentity p) >>= q = q p
@@ -2676,23 +2685,59 @@
 {-# LINE 1 "templates/GenericTemplate.hs" #-}
 {-# LINE 1 "<built-in>" #-}
 {-# LINE 1 "<command-line>" #-}
+{-# LINE 11 "<command-line>" #-}
+{-# LINE 1 "/opt/ghc/7.10.3/lib/ghc-7.10.3/include/ghcversion.h" #-}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{-# LINE 11 "<command-line>" #-}
 {-# LINE 1 "templates/GenericTemplate.hs" #-}
 -- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp 
 
-{-# LINE 30 "templates/GenericTemplate.hs" #-}
+{-# LINE 13 "templates/GenericTemplate.hs" #-}
 
 
+
+
+
+-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
+#if __GLASGOW_HASKELL__ > 706
+#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool)
+#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool)
+#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Bool)
+#else
+#define LT(n,m) (n Happy_GHC_Exts.<# m)
+#define GTE(n,m) (n Happy_GHC_Exts.>=# m)
+#define EQ(n,m) (n Happy_GHC_Exts.==# m)
+#endif
+{-# LINE 46 "templates/GenericTemplate.hs" #-}
+
+
 data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList
 
 
 
 
 
-{-# LINE 51 "templates/GenericTemplate.hs" #-}
+{-# LINE 67 "templates/GenericTemplate.hs" #-}
 
-{-# LINE 61 "templates/GenericTemplate.hs" #-}
+{-# LINE 77 "templates/GenericTemplate.hs" #-}
 
-{-# LINE 70 "templates/GenericTemplate.hs" #-}
+{-# LINE 86 "templates/GenericTemplate.hs" #-}
 
 infixr 9 `HappyStk`
 data HappyStk a = HappyStk a (HappyStk a)
@@ -2709,9 +2754,9 @@
 -- parse (a %partial parser).  We must ignore the saved token on the top of
 -- the stack in this case.
 happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =
-	happyReturn1 ans
+        happyReturn1 ans
 happyAccept j tk st sts (HappyStk ans _) = 
-	(happyTcHack j (happyTcHack st)) (happyReturn1 ans)
+        (happyTcHack j (happyTcHack st)) (happyReturn1 ans)
 
 -----------------------------------------------------------------------------
 -- Arrays only: do the next action
@@ -2719,37 +2764,35 @@
 
 
 happyDoAction i tk st
-	= {- nothing -}
+        = {- nothing -}
 
 
-	  case action of
-		0#		  -> {- nothing -}
-				     happyFail i tk st
-		-1# 	  -> {- nothing -}
-				     happyAccept i tk st
-		n | (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}
+          case action of
+                0#           -> {- nothing -}
+                                     happyFail i tk st
+                -1#          -> {- nothing -}
+                                     happyAccept i tk st
+                n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}
 
-				     (happyReduceArr Happy_Data_Array.! rule) i tk st
-				     where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))
-		n		  -> {- nothing -}
+                                                   (happyReduceArr Happy_Data_Array.! rule) i tk st
+                                                   where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))
+                n                 -> {- nothing -}
 
 
-				     happyShift new_state i tk st
-				     where (new_state) = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))
-   where (off)    = indexShortOffAddr happyActOffsets st
-         (off_i)  = (off Happy_GHC_Exts.+# i)
-	 check  = if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#))
-			then (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==#  i)
-			else False
-         (action)
+                                     happyShift new_state i tk st
+                                     where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))
+   where off    = indexShortOffAddr happyActOffsets st
+         off_i  = (off Happy_GHC_Exts.+# i)
+         check  = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#))
+                  then EQ(indexShortOffAddr happyCheck off_i, i)
+                  else False
+         action
           | check     = indexShortOffAddr happyTable off_i
           | otherwise = indexShortOffAddr happyDefActions st
 
-{-# LINE 130 "templates/GenericTemplate.hs" #-}
 
-
 indexShortOffAddr (HappyA# arr) off =
-	Happy_GHC_Exts.narrow16Int# i
+        Happy_GHC_Exts.narrow16Int# i
   where
         i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low)
         high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))
@@ -2768,13 +2811,13 @@
 -----------------------------------------------------------------------------
 -- HappyState data type (not arrays)
 
-{-# LINE 163 "templates/GenericTemplate.hs" #-}
+{-# LINE 170 "templates/GenericTemplate.hs" #-}
 
 -----------------------------------------------------------------------------
 -- Shifting a token
 
 happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =
-     let (i) = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
+     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
 --     trace "shifting the error token" $
      happyDoAction i tk new_state (HappyCons (st) (sts)) (stk)
 
@@ -2810,30 +2853,33 @@
      = happyFail 0# tk st sts stk
 happyReduce k nt fn j tk st sts stk
      = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of
-	 sts1@((HappyCons (st1@(action)) (_))) ->
-        	let r = fn stk in  -- it doesn't hurt to always seq here...
-       		happyDoSeq r (happyGoto nt j tk st1 sts1 r)
+         sts1@((HappyCons (st1@(action)) (_))) ->
+                let r = fn stk in  -- it doesn't hurt to always seq here...
+                happyDoSeq r (happyGoto nt j tk st1 sts1 r)
 
 happyMonadReduce k nt fn 0# tk st sts stk
      = happyFail 0# tk st sts stk
 happyMonadReduce k nt fn j tk st sts stk =
-        happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
-       where (sts1@((HappyCons (st1@(action)) (_)))) = happyDrop k (HappyCons (st) (sts))
-             drop_stk = happyDropStk k stk
+      case happyDrop k (HappyCons (st) (sts)) of
+        sts1@((HappyCons (st1@(action)) (_))) ->
+          let drop_stk = happyDropStk k stk in
+          happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
 
 happyMonad2Reduce k nt fn 0# tk st sts stk
      = happyFail 0# tk st sts stk
 happyMonad2Reduce k nt fn j tk st sts stk =
-       happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
-       where (sts1@((HappyCons (st1@(action)) (_)))) = happyDrop k (HappyCons (st) (sts))
-             drop_stk = happyDropStk k stk
+      case happyDrop k (HappyCons (st) (sts)) of
+        sts1@((HappyCons (st1@(action)) (_))) ->
+         let drop_stk = happyDropStk k stk
 
-             (off) = indexShortOffAddr happyGotoOffsets st1
-             (off_i) = (off Happy_GHC_Exts.+# nt)
-             (new_state) = indexShortOffAddr happyTable off_i
+             off = indexShortOffAddr happyGotoOffsets st1
+             off_i = (off Happy_GHC_Exts.+# nt)
+             new_state = indexShortOffAddr happyTable off_i
 
 
 
+          in
+          happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
 
 happyDrop 0# l = l
 happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t
@@ -2848,9 +2894,9 @@
 happyGoto nt j tk st = 
    {- nothing -}
    happyDoAction j tk new_state
-   where (off) = indexShortOffAddr happyGotoOffsets st
-         (off_i) = (off Happy_GHC_Exts.+# nt)
-         (new_state) = indexShortOffAddr happyTable off_i
+   where off = indexShortOffAddr happyGotoOffsets st
+         off_i = (off Happy_GHC_Exts.+# nt)
+         new_state = indexShortOffAddr happyTable off_i
 
 
 
@@ -2859,9 +2905,10 @@
 -- Error recovery (0# is the error token)
 
 -- parse error if we are in recovery and we fail again
-happyFail  0# tk old_st _ stk =
---	trace "failing" $ 
-    	happyError_ tk
+happyFail 0# tk old_st _ stk@(x `HappyStk` _) =
+     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
+--      trace "failing" $ 
+        happyError_ i tk
 
 {-  We don't need state discarding for our restricted implementation of
     "error".  In fact, it can cause some bogus parses, so I've disabled it
@@ -2869,16 +2916,16 @@
 
 -- discard a state
 happyFail  0# tk old_st (HappyCons ((action)) (sts)) 
-						(saved_tok `HappyStk` _ `HappyStk` stk) =
---	trace ("discarding state, depth " ++ show (length stk))  $
-	happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))
+                                                (saved_tok `HappyStk` _ `HappyStk` stk) =
+--      trace ("discarding state, depth " ++ show (length stk))  $
+        happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))
 -}
 
 -- Enter error recovery: generate an error token,
 --                       save the old token and carry on.
 happyFail  i tk (action) sts stk =
 --      trace "entering error recovery" $
-	happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)
+        happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)
 
 -- Internal happy errors:
 
@@ -2896,9 +2943,9 @@
 
 -----------------------------------------------------------------------------
 -- Seq-ing.  If the --strict flag is given, then Happy emits 
---	happySeq = happyDoSeq
+--      happySeq = happyDoSeq
 -- otherwise it emits
--- 	happySeq = happyDontSeq
+--      happySeq = happyDontSeq
 
 happyDoSeq, happyDontSeq :: a -> b -> b
 happyDoSeq   a b = a `seq` b
diff --git a/src/Text/XML/HXQ/TypeInference.hs b/src/Text/XML/HXQ/TypeInference.hs
--- a/src/Text/XML/HXQ/TypeInference.hs
+++ b/src/Text/XML/HXQ/TypeInference.hs
@@ -318,6 +318,13 @@
     return x = TI(\s n -> (s,n,x))
     TI c >>= f = TI(\s n -> let (s',m,x) = c s n; TI fx = f x in fx s' m)
 
+instance Functor TI where
+  fmap = liftM
+
+instance Applicative TI where
+  pure  = return
+  (<*>) = ap
+
 
 runTI :: TI a -> a
 runTI (TI c) = let (s,n,result) = c [] 0 in result
diff --git a/src/Text/XML/HXQ/Types.hs b/src/Text/XML/HXQ/Types.hs
--- a/src/Text/XML/HXQ/Types.hs
+++ b/src/Text/XML/HXQ/Types.hs
@@ -26,6 +26,7 @@
 import HXML(Name,AttList)
 import DeepSeq
 import Data.Char
+import Control.Monad (liftM, ap)
 
 
 buildInTypes :: [(String,String)]
@@ -439,6 +440,12 @@
     Success s >>= f = f s
     Failure ts >>= _ = Failure ts
 
+instance Functor Match where
+  fmap = liftM
+
+instance Applicative Match where
+  pure  = return
+  (<*>) = ap
 
 -- validate the XML sequence xs against the XML Schema type tp
 typeValidate :: Type -> XSeq -> Match XSeq
diff --git a/src/Text/XML/HXQ/XQuery.hs b/src/Text/XML/HXQ/XQuery.hs
--- a/src/Text/XML/HXQ/XQuery.hs
+++ b/src/Text/XML/HXQ/XQuery.hs
@@ -66,7 +66,7 @@
 #endif
 
 
-version = "0.19.0"
+version = "0.20.1"
 
 
 -- | The XQuery interpreter as an XQuery function.
diff --git a/src/hxml-0.2/LLParsing.hs b/src/hxml-0.2/LLParsing.hs
--- a/src/hxml-0.2/LLParsing.hs
+++ b/src/hxml-0.2/LLParsing.hs
@@ -25,6 +25,8 @@
     , pRun
     ) where
 
+import Prelude hiding ((<$), (<$>), (<*>), (<*), (*>), (<**>))
+
 infixl 3 <|>
 infixl 4 <*>, <$>, <^>, <?>, <$, <*, *>, <**>
 
diff --git a/src/hxml-0.2/XMLParse.hs b/src/hxml-0.2/XMLParse.hs
--- a/src/hxml-0.2/XMLParse.hs
+++ b/src/hxml-0.2/XMLParse.hs
@@ -24,6 +24,8 @@
     , parseInstance, parseDTD, parseDocument
     ) where
 
+import Prelude hiding ((<$), (<$>), (<*>), (<*), (*>), (<**>))
+
 import XMLScanner
 import LLParsing
 import XML
