State checks and UI fixes