PRF/random_to_key allocation fix