fix issues with ES 1.0.RC1 + add token_count support