diff --git a/Control/Shell/Extract.hs b/Control/Shell/Extract.hs
--- a/Control/Shell/Extract.hs
+++ b/Control/Shell/Extract.hs
@@ -113,9 +113,9 @@
   [dir] <- ls "."
   guard $ isDirectory dir
   inCustomTempDirectory "." $ do
-    mv (".." </> dir) "."
+    mv (".." </> dir) ("." </> dir)
     files <- ls dir
-    mapM_ (\f -> mv (dir </> f) "..") files
+    mapM_ (\f -> mv (dir </> f) (".." </> f)) files
 
 -- | Command + arguments to extract an archive file.
 --   Arguments must be followed immediately by the archive file name.
@@ -155,6 +155,9 @@
 -- | Iterate 'takeBaseName' until all extensions are gone.
 takeBasestName :: FilePath -> FilePath
 takeBasestName f
-  | f == f'   = f
-  | otherwise = takeBasestName f'
-  where f' = takeBaseName f 
+  | f == f'      = f
+  | unknownExt f = f
+  | otherwise    = takeBasestName f'
+  where
+    f' = takeBaseName f
+    unknownExt f = defaultMimeLookup (T.pack f) == "application/octet-stream"
diff --git a/shellmate-extras.cabal b/shellmate-extras.cabal
--- a/shellmate-extras.cabal
+++ b/shellmate-extras.cabal
@@ -1,5 +1,5 @@
 name:                shellmate-extras
-version:             0.3.2
+version:             0.3.3
 synopsis:            Extra functionality for shellmate.
 description:         HTTP downloads and parsing for various file formats.
 homepage:            https://github.com/valderman/shellmate
