Yes 500 heads followed by 500 tails could come from a fair coin. It's pretty damned unlikely to be random though, yet the example in Jon Orwant's module's documentation says that such an outcome is over 90% likely to be from a random source!
The suggestion someone else put forward of instead of putting individual values into the buckets for the test to put sequences of values in would solve that.