Tighten up failure handling and logging