diff --git a/Text/Regex/PCRE/Light.hs b/Text/Regex/PCRE/Light.hs
--- a/Text/Regex/PCRE/Light.hs
+++ b/Text/Regex/PCRE/Light.hs
@@ -176,7 +176,7 @@
 compile :: S.ByteString -> [PCREOption] -> Regex
 compile s o = case compileM s o of
     Right r -> r
-    Left  s -> error ("Text.Regex.PCRE.Light: Error in regex: " ++ s)
+    Left  e -> error ("Text.Regex.PCRE.Light: Error in regex: " ++ e)
 
 ------------------------------------------------------------------------
 
diff --git a/Text/Regex/PCRE/Light/Base.hsc b/Text/Regex/PCRE/Light/Base.hsc
--- a/Text/Regex/PCRE/Light/Base.hsc
+++ b/Text/Regex/PCRE/Light/Base.hsc
@@ -179,7 +179,7 @@
 -- | 'caseless'
 --
 -- If this bit is set, letters in the pattern match both upper and lower case
--- letters. It is equivalent to Perl's /i option, and it can be changed within a
+-- letters. It is equivalent to Perl's \/i option, and it can be changed within a
 -- pattern by a (?i) option setting. In UTF-8 mode, PCRE always understands the
 -- concept of case for characters whose values are less than 128, so caseless
 -- matching is always possible. For characters with higher values, the concept of
@@ -208,7 +208,7 @@
 -- If this bit is set, a dot metacharater in the pattern matches all
 -- characters, including those that indicate newline. Without it, a dot does
 -- not match when the current position is at a newline. This option is
--- equivalent to Perl's /s option, and it can be changed within a pattern by a
+-- equivalent to Perl's \/s option, and it can be changed within a pattern by a
 -- (?s) option setting. A negative class such as [^a] always matches newline
 -- characters, independent of the setting of this option.
 --
@@ -231,7 +231,7 @@
 -- ignored except when escaped or inside a character class. Whitespace does not
 -- include the VT character (code 11). In addition, characters between an
 -- unescaped \# outside a character class and the next newline, inclusive, are
--- also ignored. This is equivalent to Perl's /x option, and it can be changed
+-- also ignored. This is equivalent to Perl's \/x option, and it can be changed
 --within a pattern by a (?x) option setting.
 --
 -- This option makes it possible to include comments inside complicated
@@ -277,7 +277,7 @@
 -- When 'multiline' it is set, the /start of line/ and /end of line/
 -- constructs match immediately following or immediately before internal newlines
 -- in the subject string, respectively, as well as at the very start and end. This
--- is equivalent to Perl's /m option, and it can be changed within a pattern by a
+-- is equivalent to Perl's \/m option, and it can be changed within a pattern by a
 -- (?m) option setting. If there are no newlines in a subject string, or no occur-
 -- rences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect.
 -- 
@@ -545,7 +545,7 @@
 --
 -- Perl has no direct equivalent of 'notempty', but it
 -- does make a special case of a pattern match of the empty
--- string within its split() function, and when using the /g
+-- string within its split() function, and when using the \/g
 -- modifier. It is possible to emulate Perl's behaviour after
 -- matching a null string by first trying the match again at
 -- the same offset with PCRE_NOTEMPTY and PCRE_ANCHORED, and
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -4,6 +4,6 @@
 # subst standard header path variables
 if test -n "$CPPFLAGS" ; then
     echo "Found CPPFLAGS in environment: '$CPPFLAGS'"
-    sed 's,@CPPFLAGS@,'$CPPFLAGS',g;s,@LDFLAGS@,'$LDFLAGS',g'  \
+    sed 's,@CPPFLAGS@,'"$CPPFLAGS"',g;s,@LDFLAGS@,'"$LDFLAGS"',g'  \
         < pcre-light.buildinfo.in > pcre-light.buildinfo
 fi
diff --git a/pcre-light.cabal b/pcre-light.cabal
--- a/pcre-light.cabal
+++ b/pcre-light.cabal
@@ -1,5 +1,5 @@
 name:            pcre-light
-version:         0.3
+version:         0.3.1
 homepage:        http://code.haskell.org/~dons/code/pcre-light
 synopsis:        A small, efficient and portable regex library for Perl 5 compatible regular expressions
 description:
@@ -20,6 +20,8 @@
 cabal-version: >= 1.2.0
 build-type:      Configure
 tested-with:     GHC ==6.8.2, GHC ==6.6.1, Hugs ==2005
+extra-source-files: configure, pcre-light.buildinfo.in
+extra-tmp-files:    pcre-light.buildinfo
 
 flag small_base
   description: Build with new smaller base library
@@ -39,3 +41,4 @@
         build-depends: base < 3
 
     extra-libraries: pcre
+
