Performace tweaks/ thumb flash bug fix