Add defensive coding for older keypairs