diff --git a/lib/Pdf/Toolbox/Core/Object/Types.hs b/lib/Pdf/Toolbox/Core/Object/Types.hs
--- a/lib/Pdf/Toolbox/Core/Object/Types.hs
+++ b/lib/Pdf/Toolbox/Core/Object/Types.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
 
 -- | Module contains definitions of pdf objects
 --
@@ -17,6 +18,7 @@
 )
 where
 
+import Data.Monoid
 import Data.String
 import Data.ByteString (ByteString)
 
@@ -32,9 +34,9 @@
 
 -- | Names usually are used as keys in dictionaries
 --
--- They starts with \'/\', but we strip it out, see 'Text.Pdf.Parser.Object.parseName'
+-- They starts with \'/\', but we strip it out, see 'Pdf.Toolbox.Core.Parsers.Object.parseName'
 newtype Name = Name ByteString
-  deriving (Eq, Show)
+  deriving (Eq, Show, Ord, Monoid)
 
 -- | Set of key/value pairs
 newtype Dict = Dict [(Name, Object ())]
diff --git a/lib/Pdf/Toolbox/Core/Parsers/Object.hs b/lib/Pdf/Toolbox/Core/Parsers/Object.hs
--- a/lib/Pdf/Toolbox/Core/Parsers/Object.hs
+++ b/lib/Pdf/Toolbox/Core/Parsers/Object.hs
@@ -113,8 +113,9 @@
                  _ -> do
                    ch1 <- P.anyChar
                    ch2 <- P.anyChar
-                   takeStr lvl (toEnum (fromEnum ch' * 64 + fromEnum ch1 * 8 + fromEnum ch2) : res)
+                   takeStr lvl (toEnum (charToInt ch' * 64 + charToInt ch1 * 8 + charToInt ch2) : res)
       _ -> takeStr lvl (ch : res)
+  charToInt ch = fromEnum ch - 48
 
 -- |
 -- >>> parseOnly parseHexStr "<68656C6C6F>"
diff --git a/lib/Pdf/Toolbox/Core/Parsers/XRef.hs b/lib/Pdf/Toolbox/Core/Parsers/XRef.hs
--- a/lib/Pdf/Toolbox/Core/Parsers/XRef.hs
+++ b/lib/Pdf/Toolbox/Core/Parsers/XRef.hs
@@ -79,6 +79,7 @@
 parseTrailerAfterTable = do
   _ <- P.string "trailer"
   endOfLine
+  P.skipSpace
   parseDict
 
 -- | Parse XRef table entry. Returns offset, generation and whether the object is free.
diff --git a/pdf-toolbox-core.cabal b/pdf-toolbox-core.cabal
--- a/pdf-toolbox-core.cabal
+++ b/pdf-toolbox-core.cabal
@@ -1,5 +1,5 @@
 name:                pdf-toolbox-core
-version:             0.0.1.1
+version:             0.0.2.0
 synopsis:            A collection of tools for processing PDF files.
 license:             BSD3
 license-file:        LICENSE
