On error exit appropriately