Fixed possible XSS due to unhandled exceptions