Fixes to support SD card writing