Fix public key generation