Fix the secret key generation