Fixed 404 enforcement function.