Use cleaner function call to get num_tokens

Needed because previous grep_log did not work on 2.0