Clean up pubkey handling.