Add print_404 function
Use print_404 in more places