Fixes for SD card reading.

Make SD card reading a little more stable.