Simpler checking of permissions on private RSA key and other fixes.