Use 404 status code for custom 404 page

Fixes #275 and #291.