Updated to retry APDU in some cases

Updated to recognize when a card is logged out without being switched