Fix a typo in one of the logging messages.
Small refactoring of state initialization.