Fixed infinite page refresh bug in recent 404 error handling commit.