Improve handling of fatal errors