Fixed error handling of fatal errors.