Wiki plugin: properly handling 404 errors and query escaping