A few state transition bug fixes.