Bug fixes in State