Backport of important mmc card fixes