Switched to mt_rand for test data, fixed accidental global