Fixing automatic key generation.