Fix bugs with intent state