minor error fixes in print_token