diff --git a/CHANGES b/CHANGES
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+0.5.1 - 090812
+* adjusted path handling code to be more robust (so it works on
+  Windows too)
+
 0.5.0 - 090811
 * made GraphData abstract (the users don't need its internals)
 * switched to GLUT
diff --git a/hp2any-graph.cabal b/hp2any-graph.cabal
--- a/hp2any-graph.cabal
+++ b/hp2any-graph.cabal
@@ -1,5 +1,5 @@
 Name:          hp2any-graph
-Version:       0.5.0
+Version:       0.5.1
 Cabal-Version: >= 1.2
 Synopsis:      Real-time heap graphing utility and profile stream server with a reusable graphing module.
 Category:      profiling, development, utils
@@ -14,6 +14,7 @@
 Author:        Patai Gergely
 Maintainer:    Patai Gergely (patai@iit.bme.hu)
 Copyright:     (c) 2009, Patai Gergely
+Homepage:      http://www.haskell.org/haskellwiki/Hp2any
 License:       BSD3
 License-File:  LICENSE
 Stability:     experimental
diff --git a/src/HandleArgs.hs b/src/HandleArgs.hs
--- a/src/HandleArgs.hs
+++ b/src/HandleArgs.hs
@@ -14,9 +14,17 @@
              | Port
                deriving (Eq, Ord, Show)
 
-graphArgs = do
-  let fixName n = if head n `notElem` "/." then "./"++n else n
+commonArgs args = do
+  let canonMaybe a = case getArgString args a of
+                       Just p  -> Just <$> canonicalizePath p
+                       Nothing -> return Nothing
 
+  exec <- canonMaybe Exec
+  dir <- canonMaybe Cwd
+
+  return (exec,dir,argsRest args)
+
+graphArgs = do
   args <- parseArgsIO ArgsTrailing
           [ Arg Exec (Just 'e') (Just "exec")
             (argDataOptional "executable" ArgtypeString)
@@ -29,22 +37,18 @@
             "Server to connect to."
           ]
   
-  let exec = fixName <$> getArgString args Exec
-      port = getArgString args Port
-      params = unwords $ argsRest args
+  let port = getArgString args Port
+  (exec,dir,params) <- commonArgs args
 
   when (exec == Nothing && port == Nothing) $ do
     putStrLn $ argsUsage args
     putStrLn $ unlines
-                 ["You need to supply either a server to connect to or an executable"
-                 ,"with optional working directory and parameters."
+                 [ "You need to supply either a server to connect to or an executable"
+                 , "with optional working directory and parameters."
                  ]
     exitFailure
 
-  dir <- case getArgString args Cwd of
-           Just p -> Just <$> canonicalizePath p
-           Nothing -> return Nothing
-
+  -- Remote mode overrides local mode.
   let retval = case port of
                  Just p -> Left p
                  Nothing -> Right (fromJust exec,dir,params)
@@ -52,8 +56,6 @@
   return retval
 
 relayArgs = do
-  let fixName n = if head n `notElem` "/." then "./"++n else n
-
   args <- parseArgsIO ArgsTrailing
           [ Arg Exec (Just 'e') (Just "exec")
             (argDataRequired "executable" ArgtypeString)
@@ -66,12 +68,7 @@
             "Number of server port to listen on."
           ]
   
-  let Just exec = fixName <$> getArgString args Exec
-      Just port = getArgString args Port
-      params = unwords $ argsRest args
-
-  dir <- case getArgString args Cwd of
-           Just p -> Just <$> canonicalizePath p
-           Nothing -> return Nothing
+  let Just port = getArgString args Port
+  (exec,dir,params) <- commonArgs args
 
-  return (read port :: Int,exec,dir,params)
+  return (read port :: Int,fromJust exec,dir,params)
