Limited the output width of get_problem to 80

and fixed some bugs.