Fix detection of card removal and insertion.