Add CPU detection by script
Fix a bug due to typo