Closes #589: 404 page handling hook now handles template settings