Fix ugly progress bar situation while changing state.
Fix deprecated intent warnings.