Use 404 status code for custom 404 page

Fixes #275 and #291.
Merge pull request #315 from Naxiz/fix-275-291

Use 404 status code for custom 404 page