Tests refactoring

Fixed XSS issue in `error` module