some minor fixes

Add some minor fixes and TODO for one undefined variable (X509.php line 4016).