Minor improvements to failure handling