repair: Fix metadata recovery process