Some tweaks to 404 page

Specify encoding and use document.URL (maybe that works in Firefox?)