diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,10 @@
 # Release history for stack-clean-old
 
+## 0.5.1 (2023-12-17)
+- listStackSubdirs: sort after filtering
+- Directory: ignore non-directories, like .DS_Store files (#19,
+  thanks to @0rphee for reporting #18)
+
 ## 0.5 (2023-09-13)
 - simpler dry run output and use simple-prompt yesNo
 - add --yes option for --delete
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -4,8 +4,9 @@
 snapshot builds and ghc versions to recover diskspace.
 
 ## Usage
-`stack-clean-old [size|list|remove|keep-minor|purge-older|delete-work] [(-P|--project)|(-G|--global)|(-C|--compilers)|(-T|--tarballs)] [(-s|--subdirs)|(-r|--recursive)] [-d|--delete] [GHCVER]`
-
+```
+stack-clean-old [size|list|remove|keep-minor|purge-older|delete-work] [(-P|--project)|(-G|--global)|(-C|--compilers)|(-T|--tarballs)] [(-s|--subdirs)|(-r|--recursive)] [-d|--delete] [GHCVER]`
+```
 In a project directory it acts on `.stack-work/install/` by default,
 otherwise on `${STACK_ROOT}/{snapshots,programs}/`
 (the default *Stack root* is `~/.stack/`):
@@ -114,10 +115,12 @@
 (Note you can also run this tool via `stack clean-old`.)
 
 To get help you can run `stack-clean-old --help` or just:
-```ShellSession
-$ stack-clean-old --version
+`$ stack-clean-old --version`
+```
 0.5
-$ stack-clean-old
+```
+`$ stack-clean-old --help`
+```
 Stack clean up tool
 
 Usage: stack-clean-old [--version] COMMAND
@@ -143,13 +146,13 @@
 ### Command options
 Most of the commands have similar options, e.g.:
 
-```shellsession
-$ stack-clean-old remove --help
-Usage: stack-clean-old remove [(-d|--delete) [-y|--yes]]
-                              [(-P|--project) | (-S|--snapshots) |
-                                (-C|--compilers) | (-T|--tarballs) |
-                                (-G|--global)]
-                              [(-s|--subdirs) | (-r|--recursive)] GHCVER
+`$ stack-clean-old remove --help`
+```
+Usage: stack-clean-old remove [(-d|--delete) [-y|--yes]] 
+                              [(-P|--project) | (-S|--snapshots) | 
+                                (-C|--compilers) | (-T|--tarballs) | 
+                                (-G|--global)] 
+                              [(-s|--subdirs) | (-r|--recursive)] GHCVER 
                               [-o|--platform SYSTEM]
 
   Remove for a ghc version
diff --git a/src/Directories.hs b/src/Directories.hs
--- a/src/Directories.hs
+++ b/src/Directories.hs
@@ -10,7 +10,7 @@
   )
 where
 
-import Control.Monad (forM_, unless, when)
+import Control.Monad (filterM, forM_, unless, when)
 import Data.List.Extra
 import SimpleCmd ((+-+),
 #if MIN_VERSION_simple_cmd(0,2,0)
@@ -71,7 +71,7 @@
 
 listPlatforms :: Maybe String -> IO [FilePath]
 listPlatforms msystem = do
-  platforms <- listDirectory "."
+  platforms <- listDirectory "." >>= filterM doesDirectoryExist
   case msystem of
     Nothing -> return platforms
     Just s ->
@@ -83,7 +83,7 @@
 
 listCurrentDirectory :: IO [FilePath]
 listCurrentDirectory =
-  filter (\d -> head d /= '.') <$> listDirectory "."
+  listDirectory "." >>= filterM doesDirectoryExist . filter (\d -> head d /= '.')
 
 #if !MIN_VERSION_simple_cmd(0,2,0)
 warning :: String -> IO ()
diff --git a/src/Main.hs b/src/Main.hs
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -240,7 +240,7 @@
 
 listStackSubdirs :: IO [FilePath]
 listStackSubdirs =
-  listDirectory "." >>= filterM (doesDirectoryExist . (</> ".stack-work")) . L.sort
+  listDirectory "." >>= fmap L.sort . filterM (doesDirectoryExist . (</> ".stack-work"))
 
 remindDelete :: Deletion -> IO ()
 remindDelete deletion =
diff --git a/stack-clean-old.cabal b/stack-clean-old.cabal
--- a/stack-clean-old.cabal
+++ b/stack-clean-old.cabal
@@ -1,5 +1,5 @@
 name:                stack-clean-old
-version:             0.5
+version:             0.5.1
 synopsis:            Clean away old stack build artifacts
 description:
         A tool for removing old .stack-work/install builds and
