Fixing fatal error handling