diff --git a/metadata/meta-get.c b/metadata/meta-get.c
index a1d676e..4d131ae 100644
--- a/metadata/meta-get.c
+++ b/metadata/meta-get.c
@@ -123,8 +123,7 @@ main (int argc,
       tree = meta_tree_open (treefilename, FALSE);
       if (tree)
 	tree_path = g_strdup (path);
-
-      if (tree == NULL)
+      else
 	{
 	  g_printerr ("can't open metadata file %s\n", treefilename);
 	  return 1;
diff --git a/metadata/metatree.c b/metadata/metatree.c
index 3a1c12b..5470a07 100644
--- a/metadata/metatree.c
+++ b/metadata/metatree.c
@@ -532,7 +532,11 @@ meta_tree_open (const char *filename,
   tree->for_write = for_write;
   tree->fd = -1;
 
-  meta_tree_init (tree);
+  if (!meta_tree_init (tree))
+    {
+      meta_tree_unref (tree);
+      tree = NULL;
+    }
 
   return tree;
 }
@@ -659,12 +663,14 @@ meta_tree_has_new_journal_entries (MetaTree *tree)
 static void
 meta_tree_refresh_locked (MetaTree *tree)
 {
+  gboolean success;
   /* Needs to recheck since we dropped read lock */
   if (meta_tree_needs_rereading (tree))
     {
       if (tree->header)
 	meta_tree_clear (tree);
-      meta_tree_init (tree);
+      success = meta_tree_init (tree);
+      g_assert(success);
     }
   else if (meta_tree_has_new_journal_entries (tree))
     meta_journal_validate_more (tree->journal);
