x509 fixes