Fix state changing.