diff --git a/apps/tagcache.c b/apps/tagcache.c
index 9f8ce31..74ecc95 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -2210,7 +2210,7 @@ static bool build_numeric_indices(struct tagcache_header *h, int tmpfd)
     
     masterfd_pos = lseek(masterfd, tcmh.tch.entry_count * sizeof(struct index_entry),
                          SEEK_CUR);
-    if (masterfd_pos == filesize(masterfd))
+    if (masterfd_pos < 0)
     {
         logf("we can't append!");
         close(masterfd);
@@ -2957,12 +2957,7 @@ static bool commit(void)
     }
 
     if (tch.entry_count == 0)
-    {
         logf("nothing to commit");
-        close(tmpfd);
-        remove(TAGCACHE_FILE_TEMP);
-        return true;
-    }
 
     /* Fully initialize existing headers (if any) before going further. */
     tc_stat.ready = check_all_headers();
