Merge pull request #2686 from vlakoff/develop

Replace the last rand() with mt_rand()