Fixed an issue with the state service.