Handle formatting errors gracefully

Change-Id: I278acd0a4156ab78fa40341126cb05d94a664cc7