minor fixes in state system