diff --git a/ftphs.cabal b/ftphs.cabal
--- a/ftphs.cabal
+++ b/ftphs.cabal
@@ -1,5 +1,5 @@
 Name: ftphs
-Version: 1.0.4
+Version: 1.0.5
 License: LGPL
 Maintainer: John Goerzen <jgoerzen@complete.org>
 Author: John Goerzen
@@ -20,21 +20,34 @@
   * Optional lazy interaction
   * Server can serve up a real or a virtual filesystem tree
   * Standards compliant
-Hs-Source-Dirs: src
-Exposed-Modules: Network.FTP.Client,
+
+Build-Type: Simple
+Cabal-Version: >=1.2.3
+
+Flag buildtests
+  description: Build the executable to run unit tests
+  default: False
+
+Library
+  Hs-Source-Dirs: src
+  Exposed-Modules: Network.FTP.Client,
     Network.FTP.Client.Parser,
     Network.FTP.Server,
     Network.FTP.Server.Parser
-Extensions: ExistentialQuantification, OverlappingInstances, 
+  Extensions: ExistentialQuantification, OverlappingInstances, 
    UndecidableInstances, CPP
-Build-Depends: network, parsec, base,
+  Build-Depends: network, parsec, base,
                haskell98, mtl, regex-compat, 
                hslogger, MissingH>=1.0.0
-GHC-Options: -O2
+  GHC-Options: -O2
 
-Executable: runtests
-Buildable: False
-Main-Is: runtests.hs
-HS-Source-Dirs: testsrc, .
-Extensions: ExistentialQuantification, OverlappingInstances,
+Executable runtests
+  if flag(buildtests)
+    Buildable: True
+    Build-Depends: testpack, HUnit
+  else
+    Buildable: False
+  Main-Is: runtests.hs
+  HS-Source-Dirs: testsrc, src, .
+  Extensions: ExistentialQuantification, OverlappingInstances,
     UndecidableInstances, CPP
diff --git a/src/Network/FTP/Client/Parser.hs b/src/Network/FTP/Client/Parser.hs
--- a/src/Network/FTP/Client/Parser.hs
+++ b/src/Network/FTP/Client/Parser.hs
@@ -249,7 +249,7 @@
 parseDirName :: FTPResult -> Maybe String
 parseDirName (257, name:_) =
     let procq [] = []
-        procq ['"'] = []
+        procq ('"':_) = []
         procq ('"' : '"' : xs) = '"' : procq xs
         procq (x:xs) = x : procq xs
         in       
diff --git a/testsrc/runtests.hs b/testsrc/runtests.hs
new file mode 100644
--- /dev/null
+++ b/testsrc/runtests.hs
@@ -0,0 +1,25 @@
+{- arch-tag: Test runner
+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+-}
+
+module Main where 
+
+import Test.HUnit
+import Tests
+
+main = runTestTT tests
+
