Fixing secret key problems