Settings: fix crash bugs in wifi settings.