Added file check for firstboot, and cleaned up settings.c