Fixed loading of state file.