Latest key management fixes

Latest key management fixes