Fix for #36: avoid corrupting the catalog on update when there's an error in the writing process.
Fix for #36: avoid corrupting the catalog on update when there's an error in the writing process.

patrys/babel,patrys/babel