Fixed bad saving of private key