bugfixes for updating private keys