Use crypto.randomBytes
Fix test that could never fail