diff --git a/src/Action/Search.hs b/src/Action/Search.hs
index 941e3a2..e356eb3 100644
--- a/src/Action/Search.hs
+++ b/src/Action/Search.hs
@@ -64,6 +64,7 @@ targetInfo Target{..} =
 -- | Bool argument decides whether links are shown
 targetResultDisplay :: Bool -> Target -> String
 targetResultDisplay link Target{..} = unHTML $ unwords $
+        fmap fst (maybeToList targetPackage) ++
         fmap fst (maybeToList targetModule) ++
         [targetItem] ++
         ["-- " ++ targetURL | link]
diff --git a/src/Output/Types.hs b/src/Output/Types.hs
index f09c7e5..6c3c168 100644
--- a/src/Output/Types.hs
+++ b/src/Output/Types.hs
@@ -128,11 +128,15 @@ searchFingerprintsDebug store query answers = intercalate [""] $
 
 data TypesNames a where TypesNames :: TypesNames (BStr0, V.Vector Name) deriving Typeable
 
+-- At around 7000 packages, Word16 becomes insufficient
+-- because there are more than 2^16 Names, so we use Word32.
+type NameWord = Word32
+
 -- Must be a unique Name per String.
 -- First 0-99 are variables, rest are constructors.
 -- More popular type constructors have higher numbers.
 -- There are currently about 14K names, so about 25% of the bit patterns are taken
-newtype Name = Name Word16 deriving (Eq,Ord,Show,Data,Typeable,Storable,Binary)
+newtype Name = Name NameWord deriving (Eq,Ord,Show,Data,Typeable,Storable,Binary)
 
 name0 = Name 0 -- use to represent _
 
@@ -150,7 +154,7 @@ prettyName x@(Name i)
 -- | Give a name a popularity, where 0 is least popular, 1 is most popular
 popularityName :: Name -> Double
 popularityName (Name n) | isVar $ Name n = error "Can't call popularityName on a Var"
-                        | otherwise = fromIntegral (n - 100) / fromIntegral (maxBound - 100 :: Word16)
+                        | otherwise = fromIntegral (n - 100) / fromIntegral (maxBound - 100 :: NameWord)
 
 newtype Names = Names {lookupName :: Str -> Maybe Name}
 
@@ -190,10 +194,10 @@ spreadNames [] = []
 spreadNames (sortOn (negate . snd) -> xs@((_,limit):_)) = check $ f (99 + fromIntegral (length xs)) maxBound xs
     where
         check xs | all (isCon . snd) xs && length (nubOrd $ map snd xs) == length xs = xs
-                 | otherwise = error "Invalid spreadNames"
+                 | otherwise = error $ "Invalid spreadNames, length=" ++ show (length xs)
 
         -- I can only assign values between mn and mx inclusive
-        f :: Word16 -> Word16 -> [(a, Int)] -> [(a, Name)]
+        f :: NameWord -> NameWord -> [(a, Int)] -> [(a, Name)]
         f !mn !mx [] = []
         f mn mx ((a,i):xs) = (a, Name real) : f (mn-1) (real-1) xs
             where real = fromIntegral $ max mn $ min mx ideal
@@ -262,14 +266,16 @@ fpRaresFold :: (b -> b -> b) -> (Name -> b) -> Fingerprint -> b
 fpRaresFold g f Fingerprint{..} = f fpRare1 `g` f fpRare2 `g` f fpRare3
 
 instance Storable Fingerprint where
-    sizeOf _ = 64
+    sizeOf _ = 3*sizeOf name0 + 2
     alignment _ = 4
     peekByteOff ptr i = Fingerprint
-        <$> peekByteOff ptr (i+0) <*> peekByteOff ptr (i+2) <*> peekByteOff ptr (i+4)
-        <*> peekByteOff ptr (i+6) <*> peekByteOff ptr (i+7)
+        <$> peekByteOff ptr (i+0) <*> peekByteOff ptr (i+1*w) <*> peekByteOff ptr (i+2*w)
+        <*> peekByteOff ptr (i+3*w) <*> peekByteOff ptr (i+3*w + 1)
+        where w = sizeOf name0
     pokeByteOff ptr i Fingerprint{..} = do
-        pokeByteOff ptr (i+0) fpRare1 >> pokeByteOff ptr (i+2) fpRare2 >> pokeByteOff ptr (i+4) fpRare3
-        pokeByteOff ptr (i+6) fpArity >> pokeByteOff ptr (i+7) fpTerms
+        pokeByteOff ptr (i+0) fpRare1 >> pokeByteOff ptr (i+1*w) fpRare2 >> pokeByteOff ptr (i+2*w) fpRare3
+        pokeByteOff ptr (i+3*w) fpArity >> pokeByteOff ptr (i+3*w + 1) fpTerms
+        where w = sizeOf name0
 
 toFingerprint :: Sig Name -> Fingerprint
 toFingerprint sig = Fingerprint{..}
