Few bug fixes to wait for SD card to be finished