Fixed up/added code to the SD module