Fixed bugs about Wifi and Bluetooth connection and scanning