Fix error handling to avoid XSS attacks.