User creation fails when just ~10 users created

This pull request just includes the test that reproduces the bug, for reporting. Right fix of code and tests will follow.

Fail log: https://gist.github.com/kuenishi/cf174e2bf3d796fcc378