Merged changes from newer config.sh and flash.sh