Fix secret generation in config file (fixes #398)