Fix problem with overwriting the restored state by changing the language.