Convert num_tokens to int before comparison

NUM_TOKENS defaults to '256', so it was failing the assert
comparison to 256. The assert function used was also changed
so that the debug output is more useful in the future.
Merge branch 'master' into python-driver