Fix num of states calc.