Fix bug in state drawing