Use rand() instead of random().

Fixes #8