Better error handling for fatal errors