Handling of randomness is further revised in 857c19bdb7f5fb4d32af595da7286c8f4d12d21c