fix get_pubkey for imported keys