Replaced rand() with mt_rand() + prevent possible giveaway closure

mt_rand — Generate a better random value.

Excuse me, I laughed for quite a bit after reading this. Fixes #2