Fix Internal Server Error caused by looping over broken courses