Improve subprocess failure handling.