Correct bug in check_token: line length should be reset to 0.