Optimizations and fixes for cpufreq and bootfiles