Changing the challenge_or_404 call to make it more explicit and fix some bugs