Fix crashes from rotations and progress dialog not being dismissed.