Each thread uses separate random thread, other minor optimizations.