diff --git a/JVM/ClassFile.hs b/JVM/ClassFile.hs
--- a/JVM/ClassFile.hs
+++ b/JVM/ClassFile.hs
@@ -310,7 +310,7 @@
   | BoolType   -- ^ Z
   | ObjectType String -- ^ L @{class name}@
   | Array (Maybe Int) FieldType -- ^ @[{type}@
-  deriving (Eq)
+  deriving (Eq, Ord)
 
 instance Show FieldType where
   show SignedByte = "byte"
@@ -396,7 +396,7 @@
 data ReturnSignature =
     Returns FieldType
   | ReturnsVoid
-  deriving (Eq)
+  deriving (Eq, Ord)
 
 instance Show ReturnSignature where
   show (Returns t) = show t
@@ -418,7 +418,7 @@
 -- | Class method argument signature
 data MethodSignature =
     MethodSignature [ArgumentSignature] ReturnSignature
-  deriving (Eq)
+  deriving (Eq, Ord)
 
 instance Show MethodSignature where
   show (MethodSignature args ret) = "(" ++ intercalate ", " (map show args) ++ ") returns " ++ show ret
diff --git a/JVM/Common.hs b/JVM/Common.hs
--- a/JVM/Common.hs
+++ b/JVM/Common.hs
@@ -21,9 +21,6 @@
 instance Default B.ByteString where
   def = B.empty
 
-instance Default Word16 where
-  def = 0
-
 toCharList :: B.ByteString -> [Int]
 toCharList bstr = map fromIntegral $ B.unpack bstr
 
diff --git a/Java/JAR.hs b/Java/JAR.hs
--- a/Java/JAR.hs
+++ b/Java/JAR.hs
@@ -2,6 +2,7 @@
 module Java.JAR 
   (readManifest,
    readJAR,
+   readMainClass,
    addJAR
   ) where
 
@@ -33,6 +34,15 @@
   where
     good name = (str `isPrefixOf` name) && (".class" `isSuffixOf` name)
 
+-- | Read MainClass Entry of a MANIFEST.MF file
+readMainClass :: FilePath -> IO (Maybe String)
+readMainClass jarfile = do
+  Zip.withArchive [] jarfile $ do
+    m <- readManifest
+    case m of
+      Nothing -> return Nothing
+      Just mf -> return $ mainClass mf
+
 -- | Read entries from JAR file, using MANIFEST.MF if it exists.
 readJAR :: FilePath -> IO [Tree CPEntry]
 readJAR jarfile = do
@@ -46,6 +56,7 @@
                       return (Just forest)
   case r of
     Nothing -> readAllJAR jarfile
+    Just [] -> readAllJAR jarfile
     Just f  -> return f
 
 -- | Add given JAR file to ClassPath
diff --git a/hs-java.cabal b/hs-java.cabal
--- a/hs-java.cabal
+++ b/hs-java.cabal
@@ -1,5 +1,5 @@
 Name:           hs-java
-Version:        0.3.1
+Version:        0.3.3
 Cabal-Version:  >= 1.6
 License:        BSD3
 License-File:   LICENSE
@@ -42,8 +42,8 @@
   Build-Depends:  base >= 3 && <= 5, containers, binary,
                   mtl, directory, filepath, utf8-string, array,
                   bytestring, data-binary-ieee754, binary-state,
-                  control-monad-exception, data-default, MissingH,
-                  LibZip, Glob, parsec >= 3 && <4
+                  control-monad-exception, data-default >= 0.5.0,
+                  MissingH, LibZip, Glob, parsec >= 3 && <4
 
   ghc-options: -fwarn-unused-imports
 
