Moved random_initByTime() to main(), before all calls to rand(). Test_reference recomputed.