Added another log handler
Wrong parameter order (spotted by Christopher Cooper)
Moved log line
Avoid multiple logging of the same exception.
New function that checks if two RSA keys are actually the same.
Added new function and copied identity information so not to mess with any stored information.