Fix unprotected networks  and WEP bug

Fixed bug preventing to connect to unprotected network and WEP